Documentation ¶
Index ¶
- func BucketExists(name string) (exists bool, err error)
- func CreateBucket(name string) error
- func DeleteBucket(name string) error
- func DeleteObject(bucket, filename string) error
- func HeadObject(bucket, filename string) (*s3.HeadObjectOutput, error)
- func MakeBucketPublic(name string) error
- func ObjectExists(bucket, filename string) (exists bool, err error)
- func RandomBucketName() string
- func UploadObject(bucket, filename string, data []byte) (err error)
- func UploadObjectAsBase64(bucket, filename, base64Data string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BucketExists ¶
BucketExists determines if a given bucket exists
func CreateBucket ¶
CreateBucket creates a new S3 bucket. At the time of writing (2018/05/14) creating a bucket that exists and is owned by you will succeed silently.
func DeleteObject ¶
DeleteObject deletes an object from an S3 bucket
func HeadObject ¶
func HeadObject(bucket, filename string) (*s3.HeadObjectOutput, error)
HeadObject fetches simple information about about an object without actually fetching the object.
For information on what exactly is returned see: https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#HeadObjectOutput
func MakeBucketPublic ¶
MakeBucketPublic makes a bucket publicly readable over HTTP/HTTPS
func ObjectExists ¶
ObjectExists returns true if the object exists on S3, and false if not
func RandomBucketName ¶
func RandomBucketName() string
RandomBucketName creates a random string valid for AWS bucket names. Note that bucket names must be between 3 and 63 characters. Here, we're doing it 32 characters in length, because 32 is a cool number.
func UploadObject ¶
UploadObject uploads a given file to an S3 bucket
func UploadObjectAsBase64 ¶
UploadObjectAsBase64 uploads base64 data to a given S3 bucket. It's just a convenience function for `UploadObject()`
Types ¶
This section is empty.