Documentation
¶
Index ¶
- type Driver
- func (handler Driver) Delete(ctx context.Context, files []string) ([]string, error)
- func (handler Driver) Get(ctx context.Context, path string) (response.RSCloser, error)
- func (handler Driver) List(ctx context.Context, path string, recursive bool) ([]response.Object, error)
- func (handler Driver) Put(ctx context.Context, file io.ReadCloser, dst string, size uint64) error
- func (handler Driver) Source(ctx context.Context, path string, baseURL url.URL, ttl int64, isDownload bool, ...) (string, error)
- func (handler Driver) Thumb(ctx context.Context, path string) (*response.ContentResponse, error)
- func (handler Driver) Token(ctx context.Context, ttl int64, key string) (serializer.UploadCredential, error)
- type FileStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
Driver 本地策略适配器
func (Driver) List ¶
func (handler Driver) List(ctx context.Context, path string, recursive bool) ([]response.Object, error)
List 递归列取给定物理路径下所有文件
func (Driver) Source ¶
func (handler Driver) Source( ctx context.Context, path string, baseURL url.URL, ttl int64, isDownload bool, speed int, ) (string, error)
Source 获取外链URL
func (Driver) Token ¶
func (handler Driver) Token(ctx context.Context, ttl int64, key string) (serializer.UploadCredential, error)
Token 获取上传策略和认证Token,本地策略直接返回空值
type FileStream ¶
type FileStream struct { File io.ReadCloser Size uint64 VirtualPath string Name string MIMEType string }
FileStream 用户传来的文件
func (FileStream) Close ¶
func (file FileStream) Close() error
func (FileStream) GetFileName ¶
func (file FileStream) GetFileName() string
func (FileStream) GetMIMEType ¶
func (file FileStream) GetMIMEType() string
func (FileStream) GetSize ¶
func (file FileStream) GetSize() uint64
func (FileStream) GetVirtualPath ¶
func (file FileStream) GetVirtualPath() string
Click to show internal directories.
Click to hide internal directories.