s3Storage

package
v0.0.0-...-80164ef Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrS3ConfigIsRequired = errors.NewError("SYS", "S3 config is required")
	ErrLoggerIsRequired   = errors.NewError("SYS", "Logger is required")
)

Functions

This section is empty.

Types

type Builder

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

func NewBuilder

func NewBuilder() *Builder

func (*Builder) Build

func (b *Builder) Build() (*Storage, error)

func (*Builder) Config

func (b *Builder) Config(config *Config) *Builder

func (*Builder) Logger

func (b *Builder) Logger(logger Logger) *Builder

type Config

type Config struct {
	Region    string
	Host      string
	AccessKey string
	SecretKey string
}

type Logger

type Logger interface {
	LogError(ctx context.Context, errs ...error)
	LogInfo(ctx context.Context, messages ...string)
}

type Storage

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

func (*Storage) GetFile

func (s *Storage) GetFile(ctx context.Context, bucket, path string) (*storageModel.File, error)

func (*Storage) GetFileMetaData

func (s *Storage) GetFileMetaData(ctx context.Context, bucket, path string) (*storageModel.FileMetaData, error)

func (*Storage) RemoveFile

func (s *Storage) RemoveFile(ctx context.Context, bucket, path string) error

func (*Storage) Start

func (s *Storage) Start(ctx context.Context) error

func (*Storage) UploadFile

func (s *Storage) UploadFile(ctx context.Context, file *storageModel.File) error

Jump to

Keyboard shortcuts

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