Documentation ¶
Index ¶
- type IStorage
- type LocalStorage
- func (s *LocalStorage) Delete(id string) error
- func (s *LocalStorage) Exist(id string) bool
- func (s *LocalStorage) Load(id string, fn func(io.Reader) error) (err error)
- func (s *LocalStorage) LoadBytes(id string) ([]byte, error)
- func (s *LocalStorage) Path() string
- func (s *LocalStorage) Save(id, format string, fn func(io.Writer) error) error
- func (s *LocalStorage) SaveBytes(id, format string, data []byte) error
- func (s *LocalStorage) Sub(path string, clean bool) IStorage
- type S3Storage
- func (s *S3Storage) Clean() error
- func (s *S3Storage) Delete(id string) error
- func (s *S3Storage) Exist(id string) bool
- func (s *S3Storage) Load(id string, fn func(io.Reader) error) (err error)
- func (s *S3Storage) LoadBytes(id string) ([]byte, error)
- func (s *S3Storage) Path() string
- func (s *S3Storage) Save(id, format string, fn func(io.Writer) error) error
- func (s *S3Storage) SaveBytes(id, format string, data []byte) error
- func (s *S3Storage) Sub(path string, clean bool) IStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IStorage ¶
type IStorage interface { Path() string Exist(id string) bool Load(id string, fn func(io.Reader) error) error Save(id, format string, fn func(io.Writer) error) error LoadBytes(id string) ([]byte, error) SaveBytes(id, format string, data []byte) error Delete(id string) error Sub(path string, clean bool) IStorage }
var (
Storage IStorage
)
func InitStorage ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(id string) error
func (*LocalStorage) Exist ¶
func (s *LocalStorage) Exist(id string) bool
func (*LocalStorage) Path ¶
func (s *LocalStorage) Path() string
Click to show internal directories.
Click to hide internal directories.