s3

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 23 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,omitempty"`
	Bucket           string `mapstructure:"bucket,omitempty"`
	Prefix           string `mapstructure:"prefix,omitempty"`
	Region           string `mapstructure:"region,omitempty"`
	StorageClass     string `mapstructure:"storage_class,omitempty"`
	DisableSSL       bool   `mapstructure:"disable_ssl,omitempty"`
	AccessKeyId      string `mapstructure:"access_key_id,omitempty"`
	SecretAccessKey  string `mapstructure:"secret_access_key,omitempty"`
	SessionToken     string `mapstructure:"session_token,omitempty"`
	RoleArn          string `mapstructure:"role_arn,omitempty"`
	SessionName      string `mapstructure:"session_name,omitempty"`
	MaxRetries       int    `mapstructure:"max_retries,omitempty"`
	CertFile         string `mapstructure:"cert_file,omitempty"`
	MaxPartSize      int64  `mapstructure:"max_part_size,omitempty"`
	Concurrency      int    `mapstructure:"concurrency,omitempty"`
	UseListObjectsV1 bool   `mapstructure:"use_list_objects_v1,omitempty"`
	ForcePathStyle   bool   `mapstructure:"force_path_style,omitempty"`
	UseAccelerate    bool   `mapstructure:"use_accelerate,omitempty"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Validate

func (c *Config) Validate() error

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) 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