slaveinmaster

package
v3.0.0-...-3edb00a Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented       = errors.New("this method of shadowed policy is not implemented")
	ErrSlaveSrcPathNotExist = errors.New("cannot determine source file path in slave node")
	ErrWaitResultTimeout    = errors.New("timeout waiting for slave transfer result")
)

Functions

func NewDriver

func NewDriver(node cluster.Node, handler driver.Handler, policy *model.Policy) driver.Handler

NewDriver 返回新的从机指派处理器

Types

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver 影子存储策略,将上传任务指派给从机节点处理,并等待从机通知上传结果

func (*Driver) CancelToken

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

取消上传凭证

func (*Driver) Delete

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

func (*Driver) Get

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

func (*Driver) List

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

func (*Driver) Put

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

Put 将ctx中指定的从机物理文件由从机上传到目标存储策略

func (*Driver) Source

func (d *Driver) Source(ctx context.Context, path string, ttl int64, isDownload bool, speed int) (string, error)

func (*Driver) Thumb

func (d *Driver) Thumb(ctx context.Context, file *model.File) (*response.ContentResponse, error)

func (*Driver) Token

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

Jump to

Keyboard shortcuts

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