local

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Perm = 0744
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Policy *model.Policy
}

Driver 本地策略适配器

func (Driver) CancelToken

func (handler Driver) CancelToken(ctx context.Context, uploadSession *serializer.UploadSession) error

取消上传凭证

func (Driver) Delete

func (handler Driver) Delete(ctx context.Context, files []string) ([]string, error)

Delete 删除一个或多个文件, 返回未删除的文件,及遇到的最后一个错误

func (Driver) Get

func (handler Driver) Get(ctx context.Context, path string) (response.RSCloser, error)

Get 获取文件内容

func (Driver) List

func (handler Driver) List(ctx context.Context, path string, recursive bool) ([]response.Object, error)

List 递归列取给定物理路径下所有文件

func (Driver) Put

func (handler Driver) Put(ctx context.Context, file fsctx.FileHeader) error

Put 将文件流保存到指定目录

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) Thumb

func (handler Driver) Thumb(ctx context.Context, path string) (*response.ContentResponse, error)

Thumb 获取文件缩略图

func (Driver) Token

func (handler Driver) Token(ctx context.Context, ttl int64, uploadSession *serializer.UploadSession, file fsctx.FileHeader) (*serializer.UploadCredential, error)

Token 获取上传策略和认证Token,本地策略直接返回空值

func (Driver) Truncate

func (handler Driver) Truncate(ctx context.Context, src string, size uint64) error

Jump to

Keyboard shortcuts

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