bucket

package
v0.0.0-...-87774b0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsProviderConfig

type AwsProviderConfig struct {
	Config         *aws.Config
	BucketDownload string
	BucketUpload   string
}

type Bucket

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

func New

func New(bt BucketType, cfg any) (b *Bucket, err error)

func (*Bucket) Delete

func (b *Bucket) Delete(destiny string) error

func (*Bucket) Download

func (b *Bucket) Download(source, destiny string) (*os.File, error)

func (*Bucket) Upload

func (b *Bucket) Upload(reader io.Reader, destiny string) error

type BucketInterface

type BucketInterface interface {
	Upload(reader io.Reader, destiny string) error
	Download(source string, destiny string) (*os.File, error)
	Delete(string) error
}

type BucketType

type BucketType int
const (
	AwsProvider BucketType = iota
	MockProvider
)

type MockBucket

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

func (*MockBucket) Delete

func (m *MockBucket) Delete(string) error

func (*MockBucket) Download

func (m *MockBucket) Download(source string, destiny string) (*os.File, error)

func (*MockBucket) Upload

func (m *MockBucket) Upload(reader io.Reader, destiny string) error

type MockBucketConfig

type MockBucketConfig struct {
	UpdateWillReturnErr bool
}

Jump to

Keyboard shortcuts

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