s3

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFountAwsErrorCode  = "NotFound"
	NoSuchKeyAwsErrorCode = "NoSuchKey"
)
View Source
const DefaultS3ObjectsDelimiter = "/"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint         string `mapstructure:"endpoint"`
	Bucket           string `mapstructure:"bucket"`
	Prefix           string `mapstructure:"prefix"`
	Region           string `mapstructure:"region"`
	StorageClass     string `mapstructure:"storage_class"`
	DisableSSL       bool   `mapstructure:"disable_ssl"`
	AccessKeyId      string `mapstructure:"access_key_id"`
	SecretAccessKey  string `mapstructure:"secret_access_key"`
	SessionToken     string `mapstructure:"session_token"`
	RoleArn          string `mapstructure:"role_arn"`
	SessionName      string `mapstructure:"session_name"`
	MaxRetries       int    `mapstructure:"max_retries"`
	CertFile         string `mapstructure:"cert_file"`
	MaxPartSize      int64  `mapstructure:"max_part_size"`
	Concurrency      int    `mapstructure:"concurrency"`
	UseListObjectsV1 bool   `mapstructure:"use_list_objects_v1"`
	ForcePathStyle   bool   `mapstructure:"force_path_style"`
	UseAccelerate    bool   `mapstructure:"use_accelerate"`
	NoVerifySsl      bool   `mapstructure:"no_verify_ssl"`
}

func NewConfig

func NewConfig() *Config

type LogWrapper

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

func (LogWrapper) Log

func (lw LogWrapper) Log(objs ...interface{})

type Storage

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

func NewStorage

func NewStorage(ctx context.Context, cfg *Config, logLevel string) (*Storage, error)

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, filePaths ...string) error

func (*Storage) DeleteAll added in v0.1.8

func (s *Storage) DeleteAll(ctx context.Context, pathPrefix string) error

func (*Storage) Dirname

func (s *Storage) Dirname() string

func (*Storage) Exists

func (s *Storage) Exists(ctx context.Context, fileName string) (bool, error)

func (*Storage) GetCwd

func (s *Storage) GetCwd() string

func (*Storage) GetObject

func (s *Storage) GetObject(ctx context.Context, filePath string) (writer io.ReadCloser, err error)

func (*Storage) ListDir

func (s *Storage) ListDir(ctx context.Context) (files []string, dirs []storages.Storager, err error)

func (*Storage) PutObject

func (s *Storage) PutObject(ctx context.Context, filePath string, body io.Reader) error

func (*Storage) SubStorage

func (s *Storage) SubStorage(subPath string, relative bool) storages.Storager

Jump to

Keyboard shortcuts

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