s3util

package
v0.0.0-...-0ae72cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketExists

func BucketExists(s3_client *s3.S3, bucket string) bool

BucketExists checks in a bucket exists in AWS S3 with simplistic error checking

func CreateBucket

func CreateBucket(s3_client *s3.S3, region string, bucket string) error

CreateBucket creates a bucket in AWS S3 with simplistic error checking

func DeleteObject

func DeleteObject(s3_client *s3.S3, bucket string, key string) error

DeleteObject deletes a bucket in AWS S3 with simplistic error checking

func GetObject

func GetObject(s3_client *s3.S3, bucket string, key string) ([]byte, error)

GetObject retrieves the contents of the object in S3 at the provided bucket and key The contents of the file are read in full. If the key ends in ".gz" or ".bz2", the contents are automatically uncompressed.

func ObjectExists

func ObjectExists(s3_client *s3.S3, bucket string, key string) bool

ObjectExists checks if an object exists in S3 at the given bucket and key, with simplistic error handling. Returns true if the object exists and false if it does not.

func PutObject

func PutObject(s3_client *s3.S3, bucket string, key string, data []byte) error

PutObject uploads a file to S3 at the given bucket and key If the key ends in ".gz", then the contents are compressed before upload. If the key ends in ".bz2", then errors out as Go does not support writing to bzip2 (see https://github.com/golang/go/issues/4828) Returns an error if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL