s3

package
v0.0.0-...-34ec42c Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package s3 contains client configuration for interacting with AWS S3 storage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config Config, log logger.Logger) (storage.StorageClient, error)

NewClient creates a new S3 storage client

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

func (sc *S3StorageClient) BucketExists(ctx context.Context, bucketName string) (bool, error)

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)

Jump to

Keyboard shortcuts

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