guangyapan

package
v4.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	RootPath       string `json:"root_path" help:"Full path in GuangYaPan cloud drive"`
	PhoneNumber    string `json:"phone_number" type:"text" help:"Phone number for SMS login, e.g. +86 13800000000"`
	CaptchaToken   string `json:"captcha_token" help:"Captcha token required by /v1/auth/verification"`
	SendCode       bool   `json:"send_code" type:"bool" help:"Set true and save to send SMS code, it auto-resets to false after sending"`
	VerifyCode     string `json:"verify_code" type:"text" help:"SMS verification code used with phone_number; fill then save to finish login"`
	VerificationID string `json:"verification_id" type:"text" help:"Auto-generated after sending SMS code; do not edit manually"`
	AccessToken    string `json:"access_token" help:"Bearer access token (optional if refresh_token is provided)"`
	RefreshToken   string `json:"refresh_token" help:"Refresh token for auto-login/auto-refresh"`
	ClientID       string `json:"client_id" required:"true" help:"Client ID for GuangYaPan API, must be provided"`
	DeviceID       string `json:"device_id" help:"Optional custom device id (32 hex chars), auto-generated when empty"`
	DeviceSign     string `json:"device_sign" help:"Optional custom X-Device-Sign header (generated from device_id when empty)"`
	PageSize       int    `json:"page_size" type:"number" default:"100"`
	OrderBy        int    `json:"order_by" type:"number" options:"0,1,2,3,4" default:"3" help:"Sort field used by the file list"`
	SortType       int    `json:"sort_type" type:"number" options:"0,1" default:"1" help:"Sort direction used by the file list"`
}

type GuangYaPan

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

func (*GuangYaPan) Config

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

func (*GuangYaPan) Copy

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

func (*GuangYaPan) DeleteOfflineTasks

func (d *GuangYaPan) DeleteOfflineTasks(ctx context.Context, taskIDs []string) error

func (*GuangYaPan) Drop

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

func (*GuangYaPan) GetAddition

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

func (*GuangYaPan) GetDetails

func (d *GuangYaPan) GetDetails(ctx context.Context) (*model.StorageDetails, error)

func (*GuangYaPan) GetRoot

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

func (*GuangYaPan) Init

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

func (*GuangYaPan) List

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

func (*GuangYaPan) MakeDir

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

func (*GuangYaPan) Move

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

func (*GuangYaPan) OfflineDownload

func (d *GuangYaPan) OfflineDownload(ctx context.Context, fileURL string, parentDir model.Obj, fileName string) (*OfflineTask, error)

func (*GuangYaPan) OfflineList

func (d *GuangYaPan) OfflineList(ctx context.Context, taskIDs []string, statuses []int, cursor string, pageSize int) ([]OfflineTask, error)

func (*GuangYaPan) Put

func (*GuangYaPan) Remove

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

func (*GuangYaPan) Rename

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

func (*GuangYaPan) ResolveOfflineResource

func (d *GuangYaPan) ResolveOfflineResource(ctx context.Context, fileURL string) (*OfflineResolveData, error)

type OfflineBTResInfo

type OfflineBTResInfo struct {
	InfoHash       string           `json:"infoHash"`
	FileName       string           `json:"fileName"`
	FileSize       int64            `json:"fileSize"`
	SubfilesNum    int              `json:"subfilesNum"`
	Subfiles       []OfflineSubfile `json:"subfiles"`
	CreateTime     int64            `json:"createTime"`
	ExcludeIndices []int            `json:"excludeIndices"`
}

type OfflineResolveData

type OfflineResolveData struct {
	ResType   int               `json:"resType"`
	BTResInfo *OfflineBTResInfo `json:"btResInfo"`
	URL       string            `json:"url"`
}

type OfflineSubfile

type OfflineSubfile struct {
	FileName  string `json:"fileName"`
	FileIndex *int   `json:"fileIndex"`
	FileSize  int64  `json:"fileSize"`
}

type OfflineTask

type OfflineTask struct {
	TaskID     string `json:"taskId"`
	FileName   string `json:"fileName"`
	TotalSize  int64  `json:"totalSize"`
	Status     int    `json:"status"`
	CreateTime int64  `json:"createTime"`
	Res        string `json:"res"`
	ResType    int    `json:"resType"`
	Progress   int    `json:"progress"`
	FileID     string `json:"fileId"`
	IsDir      bool   `json:"isDir"`
	Exist      bool   `json:"exist"`
}

Jump to

Keyboard shortcuts

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