Documentation
¶
Index ¶
- type LocalStorage
- func (p *LocalStorage) Abort(ctx context.Context, file *common.File) error
- func (p *LocalStorage) Delete(ctx context.Context, file *common.File) error
- func (p *LocalStorage) Destroy() error
- func (p *LocalStorage) Get(ctx context.Context, file *common.File) (string, error)
- func (p *LocalStorage) Init() error
- func (p *LocalStorage) LocalPath(file *common.File) string
- func (p *LocalStorage) Put(ctx context.Context, file *common.File) (string, error)
- func (p *LocalStorage) Readable(ctx context.Context, file *common.File) (string, error)
- func (p *LocalStorage) Writable(ctx context.Context, file *common.File) (string, error)
- type Persister
- type S3Storage
- func (p *S3Storage) Abort(ctx context.Context, file *common.File) error
- func (p *S3Storage) Delete(ctx context.Context, file *common.File) error
- func (p *S3Storage) Destroy() error
- func (p *S3Storage) Get(ctx context.Context, file *common.File) (string, error)
- func (p *S3Storage) Init() error
- func (p *S3Storage) LocalPath(file *common.File) string
- func (p *S3Storage) Put(ctx context.Context, file *common.File) (string, error)
- func (p *S3Storage) Readable(ctx context.Context, file *common.File) (string, error)
- func (p *S3Storage) RemotePath(file *common.File) string
- func (p *S3Storage) Writable(ctx context.Context, file *common.File) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage 提供本地持久化服务
func NewLocalStorage ¶
func NewLocalStorage(path string) *LocalStorage
NewLocalStorage 返回本地持久化服务实例. For Unix system, path should meet unix naming rules, like "/path/to/a/b/c".
func (*LocalStorage) LocalPath ¶
func (p *LocalStorage) LocalPath(file *common.File) string
LocalPath 本地文件持久化路径.
type Persister ¶
type Persister interface { Init() (err error) Destroy() (err error) Writable(ctx context.Context, file *common.File) (path string, err error) Put(ctx context.Context, file *common.File) (string, error) Readable(ctx context.Context, file *common.File) (path string, err error) Get(ctx context.Context, file *common.File) (string, error) Abort(ctx context.Context, file *common.File) error Delete(ctx context.Context, file *common.File) error }
Persister 持久化接口定义
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage 提供s3持久化服务
func NewS3Storage ¶
func NewS3Storage(cfg *conf.MinioConfig) (*S3Storage, error)
NewS3Storage 返回s3持久化服务实例. For Unix system, path should meet unix naming rules, like "/path/to/a/b/c".
func (*S3Storage) RemotePath ¶
RemotePath 服务端文件持久化路径.
Click to show internal directories.
Click to hide internal directories.