Documentation ¶
Overview ¶
Package s3 contains client configuration for interacting with AWS S3 storage
Index ¶
- func NewClient(config Config, log logger.Logger) (storage.StorageClient, error)
- type Config
- type S3StorageClient
- func (sc *S3StorageClient) BucketExists(ctx context.Context, bucketName string) (bool, error)
- func (sc *S3StorageClient) CreateBucket(ctx context.Context, name string) error
- func (sc *S3StorageClient) Download(ctx context.Context, bucket, key string) (*storage.StorageDownloadItem, error)
- func (sc *S3StorageClient) Upload(ctx context.Context, item storage.StorageItem) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Region is the region that the bucket will be in Region string // KeyID is the AWS Access Key ID KeyID string // SecretKey is the AWS Secret Key SecretKey string // SessionToken is th AWS Session token SessionToken string }
Config is the configuration for setting up AWS S3 client
type S3StorageClient ¶
type S3StorageClient struct {
// contains filtered or unexported fields
}
S3StorageClient is a structure that is a wrapper around an AWS S3 client
func (*S3StorageClient) BucketExists ¶
BucketExists checks whether a bucket exists in the current account.
func (*S3StorageClient) CreateBucket ¶
func (sc *S3StorageClient) CreateBucket(ctx context.Context, name string) error
CreateBucket creates a bucket with the specified name in the specified Region.
func (*S3StorageClient) Download ¶
func (sc *S3StorageClient) Download(ctx context.Context, bucket, key string) (*storage.StorageDownloadItem, error)
func (*S3StorageClient) Upload ¶
func (sc *S3StorageClient) Upload(ctx context.Context, item storage.StorageItem) (string, error)
Click to show internal directories.
Click to hide internal directories.