s3

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCode added in v0.10.0

func ErrCode(msg string, err error) error

Types

type S3

type S3 struct {
	Service             s3iface.S3API
	LoggingBucket       string
	LoggingBucketPrefix string
}

S3 is a wrapper around the aws S3 service with some default config info

func NewSession

func NewSession(account common.Account) S3

NewSession creates a new S3 session

func (*S3) BucketEmpty added in v0.3.0

func (s *S3) BucketEmpty(ctx context.Context, bucket string) (bool, error)

BucketEmpty lists the objects in a bucket with a max of 1, if there are any objects returned, we return false

func (*S3) BucketEmptyWithFilter added in v0.11.0

func (s *S3) BucketEmptyWithFilter(ctx context.Context, bucket string, max int64, filter func(key *string) bool) (bool, error)

BucketEmptyWithFilter lists the objects in a bucket with a max of `max`. If the returned object(s) match(es) the filter, we return false

func (*S3) BucketExists added in v0.2.0

func (s *S3) BucketExists(ctx context.Context, bucketName string) (bool, error)

BucketExists checks if a bucket exists

func (*S3) CreateBucket added in v0.2.0

func (s *S3) CreateBucket(ctx context.Context, input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)

CreateBucket handles checking if a bucket exists and creating it

func (*S3) CreateObject added in v0.10.0

func (s *S3) CreateObject(ctx context.Context, input *s3.PutObjectInput) (*s3.PutObjectOutput, error)

CreateObject creates an object in S3

func (*S3) DeleteEmptyBucket added in v0.2.0

func (s *S3) DeleteEmptyBucket(ctx context.Context, input *s3.DeleteBucketInput) error

DeleteEmptyBucket handles deleting an empty bucket

func (*S3) DeleteObject added in v0.11.0

func (s *S3) DeleteObject(ctx context.Context, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)

DeleteObject deletes an object from S3

func (*S3) GetBucketLogging added in v0.6.0

func (s *S3) GetBucketLogging(ctx context.Context, bucket string) (*s3.LoggingEnabled, error)

GetBucketLogging gets a buckets logging configuration

func (*S3) GetBucketTags added in v0.2.0

func (s *S3) GetBucketTags(ctx context.Context, bucket string) ([]*s3.Tag, error)

GetBucketTags handles getting the tags for a bucket

func (*S3) GetObjectTagging added in v0.11.0

func (s *S3) GetObjectTagging(ctx context.Context, input *s3.GetObjectTaggingInput) ([]*s3.Tag, error)

GetObjectTagging gets the tagging data from an object is S3

func (*S3) ListBuckets added in v0.2.0

func (s *S3) ListBuckets(ctx context.Context, input *s3.ListBucketsInput) ([]*s3.Bucket, error)

ListBuckets handles getting a list of buckets in an account

func (*S3) TagBucket added in v0.2.0

func (s *S3) TagBucket(ctx context.Context, bucket string, tags []*s3.Tag) error

TagBucket adds tags to a bucket

func (*S3) UpdateBucketEncryption added in v0.4.0

func (s *S3) UpdateBucketEncryption(ctx context.Context, input *s3.PutBucketEncryptionInput) error

UpdateBucketEncryption sets the bucket encryption

func (*S3) UpdateBucketLogging added in v0.5.0

func (s *S3) UpdateBucketLogging(ctx context.Context, bucket, logBucket, logPrefix string) error

UpdateBucketLogging configures the bucket logging

func (*S3) UpdateBucketPolicy added in v0.3.0

func (s *S3) UpdateBucketPolicy(ctx context.Context, input *s3.PutBucketPolicyInput) error

UpdateBucketPolicy sets a bucket access policy

func (*S3) UpdateWebsiteConfig added in v0.3.0

func (s *S3) UpdateWebsiteConfig(ctx context.Context, input *s3.PutBucketWebsiteInput) error

UpdateWebsiteConfig sets the configuration for an s3 website, defaults index suffix to index.html

Jump to

Keyboard shortcuts

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