Documentation ¶
Overview ¶
Package aws provides an S3 client for AWS
Index ¶
- type DefaultClient
- func (a *DefaultClient) DeleteObject(ctx context.Context, bucket string, key string) error
- func (a *DefaultClient) DownloadObject(ctx context.Context, bucket, key string, buf []byte) (int64, error)
- func (a *DefaultClient) StreamObjects(ctx context.Context, bucket, prefix string, objectChan chan *ObjectResults, ...)
- type ObjectInfo
- type ObjectResults
- type S3Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
DefaultClient is an implementation of the S3Client for AWS
func (*DefaultClient) DeleteObject ¶ added in v1.69.0
DeleteObject deletes the object with the given key in the specified bucket
func (*DefaultClient) DownloadObject ¶
func (a *DefaultClient) DownloadObject(ctx context.Context, bucket, key string, buf []byte) (int64, error)
DownloadObject downloads the contents of the object.
func (*DefaultClient) StreamObjects ¶ added in v1.69.0
func (a *DefaultClient) StreamObjects(ctx context.Context, bucket, prefix string, objectChan chan *ObjectResults, errChan chan error, doneChan chan struct{})
StreamObjects continuously pulls & batches ObjectInfo from S3 before sending down the objectChan.
type ObjectInfo ¶
ObjectInfo contains necessary info to process S3 objects
type ObjectResults ¶ added in v1.69.0
type ObjectResults struct {
Objects []*ObjectInfo
}
ObjectResults contain a batch of ObjectInfo
type S3Client ¶
type S3Client interface { // StreamObjects continuously pulls & batches ObjectInfo from S3 before sending down the objectChan. // Errors are sent down the errChan and stop the process. When no more objects are retrieved from S3, the doneChan is closed. StreamObjects(ctx context.Context, bucket, prefix string, objectChan chan *ObjectResults, errChan chan error, doneChan chan struct{}) // DownloadObject downloads the contents of the object into the buffer. DownloadObject(ctx context.Context, bucket, key string, buf []byte) (int64, error) // DeleteObject deletes the object with the given key in the specified bucket DeleteObject(ctx context.Context, bucket string, key string) error }
S3Client provides a client for S3 object operations
Click to show internal directories.
Click to hide internal directories.