_123

package
v3.37.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: AGPL-3.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Api              = "https://www.123pan.com/api"
	AApi             = "https://www.123pan.com/a/api"
	BApi             = "https://www.123pan.com/b/api"
	MainApi          = BApi
	SignIn           = MainApi + "/user/sign_in"
	Logout           = MainApi + "/user/logout"
	UserInfo         = MainApi + "/user/info"
	FileList         = MainApi + "/file/list/new"
	DownloadInfo     = MainApi + "/file/download_info"
	Mkdir            = MainApi + "/file/upload_request"
	Move             = MainApi + "/file/mod_pid"
	Rename           = MainApi + "/file/rename"
	Trash            = MainApi + "/file/trash"
	UploadRequest    = MainApi + "/file/upload_request"
	UploadComplete   = MainApi + "/file/upload_complete"
	S3PreSignedUrls  = MainApi + "/file/s3_repare_upload_parts_batch"
	S3Auth           = MainApi + "/file/s3_upload_object/auth"
	UploadCompleteV2 = MainApi + "/file/upload_complete/v2"
	S3Complete       = MainApi + "/file/s3_complete_multipart_upload"
)

Variables

This section is empty.

Functions

func GetApi added in v3.30.0

func GetApi(rawUrl string) string

Types

type Addition

type Addition struct {
	Username string `json:"username" required:"true"`
	Password string `json:"password" required:"true"`
	driver.RootID
	//OrderBy        string `json:"order_by" type:"select" options:"file_id,file_name,size,update_at" default:"file_name"`
	//OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
	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) CreateTime added in v3.27.0

func (f File) CreateTime() time.Time

func (File) GetHash added in v3.27.0

func (f File) GetHash() utils.HashInfo

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

func (File) Thumb added in v3.22.0

func (f File) Thumb() string

type Files

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

type Pan123

type Pan123 struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*Pan123) APIRateLimit added in v3.31.0

func (d *Pan123) APIRateLimit(ctx context.Context, api string) error

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) 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 S3PreSignedURLs added in v3.16.0

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