This a simple interface to some common S3 tasks.
For example:
import (
s3 "github.com/meowgorithm/baby-s3"
)
func main() {
if err := s3.CreateBucket("my-cute-bucket"); err != nil {
fmt.Println("It didn't work :(", err)
return
}
if err := s3.MakeBucketPublic("my-cute-bucket"); err != nil {
fmt.Println("It didn't work. Weird :/", err)
}
err := s3.UploadObject("my-cute-bucket", "some-bytes.txt", []byte("a few nice bytes"));
err != nil {
fmt.Println("Nope :(", err)
}
}
AWS loves it when you put settings in environment variables, so you'll need to do that to work with this library. Set the following:
AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY
AWS_REGION
This only dependency of this library is github.com/aws/aws-sdk-go
. More
details can be found in Gopkg.toml
. If you use dep
to manage your
dependencies the AWS SDK will be installed automatically.
MIT