Versions in this module Expand all Collapse all v0 v0.4.1 Jul 9, 2019 v0.4.0 Jun 20, 2019 Changes in this version + const LocalStorageDriver + var ErrEmptyKey = StorageError + var ErrInvalidValue = StorageError + var ErrKeyNotFound = StorageError + var ErrRangeNotSatisfiable = StorageError + func IsEmptyKey(err error) bool + func IsInvalidValue(err error) bool + func IsKeyNotFound(err error) bool + func IsNilError(err error) bool + func IsRangeNotSatisfiable(err error) bool + func Register(name string, builder StorageBuilder) + type Manager struct + func NewManager(cfg *config.Config) (*Manager, error) + func (sm *Manager) Get(name string) (*Store, error) + type Raw struct + Bucket string + Key string + Length int64 + Offset int64 + type StorageBuilder func(conf string) (StorageDriver, error) + type StorageDriver interface + Get func(ctx context.Context, raw *Raw) (io.Reader, error) + GetBytes func(ctx context.Context, raw *Raw) ([]byte, error) + Put func(ctx context.Context, raw *Raw, data io.Reader) error + PutBytes func(ctx context.Context, raw *Raw, data []byte) error + Remove func(ctx context.Context, raw *Raw) error + Stat func(ctx context.Context, raw *Raw) (*StorageInfo, error) + func NewLocalStorage(conf string) (StorageDriver, error) + type StorageError struct + Code int + Msg string + func (s StorageError) Error() string + type StorageInfo struct + CreateTime time.Time + ModTime time.Time + Path string + Size int64 + type Store struct + func NewStore(name string, builder StorageBuilder, cfg string) (*Store, error) + func (s *Store) Get(ctx context.Context, raw *Raw) (io.Reader, error) + func (s *Store) GetBytes(ctx context.Context, raw *Raw) ([]byte, error) + func (s *Store) Name() string + func (s *Store) Put(ctx context.Context, raw *Raw, data io.Reader) error + func (s *Store) PutBytes(ctx context.Context, raw *Raw, data []byte) error + func (s *Store) Remove(ctx context.Context, raw *Raw) error + func (s *Store) Stat(ctx context.Context, raw *Raw) (*StorageInfo, error) + func (s *Store) Type() config.PluginType