s3

package
v0.0.0-...-048a247 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCacheControl = aws.String("public, max-age=15552000")
	AclPublicRead       = aws.String("public-read")
	AclPrivate          = aws.String("private")
)

Functions

This section is empty.

Types

type Instance

type Instance interface {
	UploadFile(ctx context.Context, opts *s3.PutObjectInput) error
	DownloadFile(ctx context.Context, output io.Writer, opts *s3.GetObjectInput) error
	DeleteFile(ctx context.Context, opts *s3.DeleteObjectInput) error
	ListBuckets(ctx context.Context) (*s3.ListBucketsOutput, error)
	CopyFile(ctx context.Context, opts *s3.CopyObjectInput) error
	SetACL(ctx context.Context, opts *s3.PutObjectAclInput) error
	ComposeKey(s ...string) string
}

func New

func New(ctx context.Context, o Options) (Instance, error)

func NewMock

func NewMock(ctx context.Context, files map[string]map[string][]byte) (Instance, error)

type MockInstance

type MockInstance struct {
	// contains filtered or unexported fields
}

func (*MockInstance) ComposeKey

func (a *MockInstance) ComposeKey(s ...string) string

func (*MockInstance) CopyFile

func (a *MockInstance) CopyFile(ctx context.Context, opts *s3.CopyObjectInput) error

TODO

func (*MockInstance) DeleteFile

func (a *MockInstance) DeleteFile(ctx context.Context, opts *s3.DeleteObjectInput) error

func (*MockInstance) DownloadFile

func (a *MockInstance) DownloadFile(ctx context.Context, output io.Writer, opts *s3.GetObjectInput) error

func (*MockInstance) ListBuckets

func (a *MockInstance) ListBuckets(ctx context.Context) (*s3.ListBucketsOutput, error)

func (*MockInstance) SetACL

func (a *MockInstance) SetACL(ctx context.Context, opts *s3.PutObjectAclInput) error

TODO

func (*MockInstance) SetConnected

func (a *MockInstance) SetConnected(connected bool)

func (*MockInstance) UploadFile

func (a *MockInstance) UploadFile(ctx context.Context, opts *s3.PutObjectInput) error

type Options

type Options struct {
	Region      string
	Endpoint    string
	AccessToken string
	SecretKey   string
	Namespace   string
}

Jump to

Keyboard shortcuts

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