plugin_storage_123

package module
v0.0.0-...-9732905 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API             = "https://www.123pan.com/b/api"
	SignIn          = API + "/user/sign_in"
	UserInfo        = API + "/user/info"
	FileList        = API + "/file/list/new"
	DownloadInfo    = API + "/file/download_info"
	Mkdir           = API + "/file/upload_request"
	Move            = API + "/file/mod_pid"
	Rename          = API + "/file/rename"
	Trash           = API + "/file/trash"
	UploadRequest   = API + "/file/upload_request"
	UploadComplete  = API + "/file/upload_complete"
	S3PreSignedUrls = API + "/file/s3_repare_upload_parts_batch"
	S3Complete      = API + "/file/s3_complete_multipart_upload"
)

Variables

This section is empty.

Functions

func GetValue

func GetValue[T any](t any) (o T, ok bool)

func Plugin

func Plugin() (model.PluginControl, error)

Types

type Addition

type Addition struct {
	Username       string `json:"username" required:"true"`
	Password       string `json:"password" required:"true"`
	RootFolderID   string `json:"root_folder_id"`
	OrderBy        string `json:"order_by" type:"select" options:"file_name,size,update_at" default:"file_name"`
	OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
	StreamUpload   bool   `json:"stream_upload"`
	AccessToken    string
}

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
}

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

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

func (*Pan123) GetStorage

func (d *Pan123) GetStorage() *model.Storage

func (*Pan123) Init

func (d *Pan123) Init(ctx context.Context) 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) Other

func (d *Pan123) Other(ctx context.Context, args model.OtherArgs) (interface{}, 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

func (*Pan123) SetStatus

func (d *Pan123) SetStatus(status string)

func (*Pan123) SetStorage

func (d *Pan123) SetStorage(storage model.Storage)

type S3PreSignedURLs

type S3PreSignedURLs struct {
	Data struct {
		PreSignedUrls map[string]string `json:"presignedUrls"`
	} `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"`
		Reuse           bool   `json:"Reuse"`
		EndPoint        string `json:"EndPoint"`
		StorageNode     string `json:"StorageNode"`
		UploadId        string `json:"UploadId"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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