_123

package
v3.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: AGPL-3.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() driver.Driver

Types

type Addition

type Addition struct {
	Username       string `json:"username" required:"true"`
	Password       string `json:"password" required:"true"`
	OrderBy        string `json:"order_by" type:"select" options:"name,fileId,updateAt,createAt" default:"name"`
	OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
	driver.RootID
	// define other
	StreamUpload bool `json:"stream_upload"`
}

type BaseResp

type BaseResp struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type DownResp

type DownResp struct {
	BaseResp
	Data struct {
		DownloadUrl string `json:"DownloadUrl"`
	} `json:"data"`
}

type File

type File struct {
	FileName    string    `json:"FileName"`
	Size        int64     `json:"Size"`
	UpdateAt    time.Time `json:"UpdateAt"`
	FileId      int64     `json:"FileId"`
	Type        int       `json:"Type"`
	Etag        string    `json:"Etag"`
	S3KeyFlag   string    `json:"S3KeyFlag"`
	DownloadUrl string    `json:"DownloadUrl"`
}

func (File) GetID

func (f File) GetID() string

func (File) GetName

func (f File) GetName() string

func (File) GetPath

func (f File) GetPath() string

func (File) GetSize

func (f File) GetSize() int64

func (File) IsDir

func (f File) IsDir() bool

func (File) ModTime

func (f File) ModTime() time.Time

type Files

type Files struct {
	BaseResp
	Data struct {
		InfoList []File `json:"InfoList"`
		Next     string `json:"Next"`
	} `json:"data"`
}

type Pan123

type Pan123 struct {
	model.Storage
	Addition
	AccessToken string
}

func (*Pan123) Config

func (d *Pan123) Config() driver.Config

func (*Pan123) Copy

func (d *Pan123) Copy(ctx context.Context, srcObj, dstDir model.Obj) error

func (*Pan123) Drop

func (d *Pan123) Drop(ctx context.Context) error

func (*Pan123) GetAddition

func (d *Pan123) GetAddition() driver.Additional

func (*Pan123) Init

func (d *Pan123) Init(ctx context.Context, storage model.Storage) error
func (d *Pan123) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

func (*Pan123) List

func (d *Pan123) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*Pan123) MakeDir

func (d *Pan123) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error

func (*Pan123) Move

func (d *Pan123) Move(ctx context.Context, srcObj, dstDir model.Obj) error

func (*Pan123) Put

func (d *Pan123) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error

func (*Pan123) Remove

func (d *Pan123) Remove(ctx context.Context, obj model.Obj) error

func (*Pan123) Rename

func (d *Pan123) Rename(ctx context.Context, srcObj model.Obj, newName string) error

type TokenResp

type TokenResp struct {
	BaseResp
	Data struct {
		Token string `json:"token"`
	} `json:"data"`
}

type UploadResp

type UploadResp struct {
	BaseResp
	Data struct {
		AccessKeyId     string `json:"AccessKeyId"`
		Bucket          string `json:"Bucket"`
		Key             string `json:"Key"`
		SecretAccessKey string `json:"SecretAccessKey"`
		SessionToken    string `json:"SessionToken"`
		FileId          int64  `json:"FileId"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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