storage

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileNotFound = errors.New("file not found")
View Source
var ErrNotSupported = errors.New("operation not supported")
View Source
var ErrTypeMismatch = errors.New("type mismatch")

Functions

func NewFile

func NewFile(name string, cfg FileConfig) interfaces.IStorage

func NewS3

func NewS3(name string, cfg S3Config) interfaces.IStorage

Types

type File

type File struct {
	Name string
	// contains filtered or unexported fields
}

func (*File) Delete

func (t *File) Delete(name string) error

func (*File) GetModified

func (t *File) GetModified(name string) (int64, error)

func (*File) GetSize

func (t *File) GetSize(name string) (int64, error)

func (*File) Has

func (t *File) Has(name string) bool

func (*File) Init

func (t *File) Init(app interfaces.IEngine) error

func (*File) IsFolder

func (t *File) IsFolder(name string) (bool, error)

func (*File) List

func (t *File) List(folder string) ([]string, error)

func (*File) Put

func (t *File) Put(name string, data io.Reader) error

func (*File) Read

func (t *File) Read(name string) (io.ReadCloser, error)

func (*File) Stop

func (t *File) Stop() error

func (*File) StoreFolder

func (t *File) StoreFolder(name string) error

func (*File) String

func (t *File) String() string

type FileConfig added in v0.4.3

type FileConfig struct {
	Folder string `yaml:"folder"`
}

type Mock added in v0.3.0

type Mock struct {
	Name string
}

func (*Mock) Delete added in v0.3.0

func (t *Mock) Delete(name string) error

func (*Mock) GetModified added in v0.3.0

func (t *Mock) GetModified(name string) (int64, error)

func (*Mock) GetSize added in v0.3.0

func (t *Mock) GetSize(name string) (int64, error)

func (*Mock) Has added in v0.3.0

func (t *Mock) Has(name string) bool

func (*Mock) Init added in v0.3.0

func (t *Mock) Init(_ interfaces.IEngine) error

func (*Mock) IsFolder added in v0.3.0

func (t *Mock) IsFolder(name string) (bool, error)

func (*Mock) List added in v0.3.0

func (t *Mock) List(path string) ([]string, error)

func (*Mock) Put added in v0.3.0

func (t *Mock) Put(name string, data io.Reader) error

func (*Mock) Read added in v0.3.0

func (t *Mock) Read(name string) (io.ReadCloser, error)

func (*Mock) Stop added in v0.3.0

func (t *Mock) Stop() error

func (*Mock) StoreFolder added in v0.3.0

func (t *Mock) StoreFolder(name string) error

func (*Mock) String added in v0.3.0

func (t *Mock) String() string

type S3

type S3 struct {
	Name string
	// contains filtered or unexported fields
}

func (*S3) Delete

func (t *S3) Delete(name string) error

func (*S3) GetModified

func (t *S3) GetModified(name string) (int64, error)

func (*S3) GetSize

func (t *S3) GetSize(name string) (int64, error)

func (*S3) Has

func (t *S3) Has(name string) bool

func (*S3) Init

func (t *S3) Init(app interfaces.IEngine) error

func (*S3) IsFolder

func (t *S3) IsFolder(name string) (bool, error)

func (*S3) List

func (t *S3) List(path string) ([]string, error)

func (*S3) Put

func (t *S3) Put(name string, data io.Reader) error

func (*S3) Read

func (t *S3) Read(name string) (io.ReadCloser, error)

func (*S3) Stop

func (t *S3) Stop() error

func (*S3) StoreFolder

func (t *S3) StoreFolder(name string) error

func (*S3) String

func (t *S3) String() string

type S3Config

type S3Config struct {
	URL         string `yaml:"url"`
	AccessKey   string `yaml:"access_key"`
	SecretKey   string `yaml:"secret_key"`
	UseSSL      bool   `yaml:"use_ssl"`
	ForceDelete bool   `yaml:"force_delete"`
	Location    string `yaml:"location"`
	Bucket      string `yaml:"bucket"`
}

Jump to

Keyboard shortcuts

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