Documentation ¶
Overview ¶
Package s3client is a wrapper around the AWS S3 connection.
Package s3client is a wrapper around the AWS S3 connection.
Index ¶
Constants ¶
View Source
const ( // DefaultMultipartChunkSize is the max size of a multipart chunk. DefaultMultipartChunkSize int64 = 1024 * 1024 * 100 // 100Mb chunk for multipart upload by default. )
Variables ¶
View Source
var ( ErrPathNoBucketSeparator = errors.New("no bucket separator in S3 path") ErrPathNoKey = errors.New("no key in S3 path") )
Functions ¶
This section is empty.
Types ¶
type BucketClient ¶
type BucketClient interface { Exists(key string) (bool, error) GetSize(key string, callerPays bool) (int64, error) GetObject(key string, callerPays bool) ([]byte, error) Delete(key string) error Copy(src, dst string, validateEtag, callerPays bool) error IsSrcNewer(src, dst string, callerPays bool) (bool, error) GetPresignedURL(key string, duration time.Duration) (string, error) GetETag(key string) (string, error) }
func NewBucketClient ¶
func NewBucketClient(s3 *s3.S3, bucket string) BucketClient
NewBucketClient returns a new S3Bucket
func NewBucketClientWithClient ¶
func NewBucketClientWithClient(client S3Client, bucket string) BucketClient
NewBucketClientWithClient creates a new bucket's client using S3Client interface.
type S3Client ¶
type S3Client interface { CreateBucket(bucket string) (string, error) Exists(obj S3Path) (bool, error) GetSize(obj S3Path, callerPays bool) (int64, error) GetObject(objPath S3Path, callerPays bool) ([]byte, error) Delete(obj S3Path) error Copy(src, dst S3Path, validateEtag, callerPays bool) error IsSrcNewer(src, dst S3Path, callerPays bool) (bool, error) GetPresignedURL(obj S3Path, duration time.Duration) (string, error) GetETag(obj S3Path) (string, error) }
S3Client is a client for AWS S3 storage.
func NewClientFromS3 ¶
NewClientFromS3 sets the AWS S3 connection and returns an S3Client interface.
Click to show internal directories.
Click to hide internal directories.