api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderByName OrderType = "name"
	OrderByTime OrderType = "time"
	OrderBySize OrderType = "size"

	CopyOperate   Operate = "copy"
	MoveOperate   Operate = "move"
	RenameOperate Operate = "rename"
	DeleteOperate Operate = "delete"
)

Variables

This section is empty.

Functions

func BodyList

func BodyList(slice []string) string

func BodyNumList

func BodyNumList(slice []string) string

func BoolToInt

func BoolToInt(b bool) int

func BoolToStr

func BoolToStr(b bool) string

func EncryptMd5

func EncryptMd5(e string) string

func FixToBaiduPath

func FixToBaiduPath(rclonePath string) string

fixToBaiduPath baidu path need to begin with "/" and use "/" to split

func FixToBaiduPathList

func FixToBaiduPathList(rclonePath []string) []string

Types

type BaiduApi

type BaiduApi struct {
}

func (*BaiduApi) Create

func (b *BaiduApi) Create(path string, preCreateFileData *PreCreateFileData, uploadId string) (opts *rest.Opts, err error)

上传

func (*BaiduApi) CreateDir

func (b *BaiduApi) CreateDir(path string, isdir bool) (opts *rest.Opts, err error)

func (*BaiduApi) DeleteDirsOrFiles

func (b *BaiduApi) DeleteDirsOrFiles(fileIdList []string) (opts *rest.Opts, err error)

func (*BaiduApi) DownFileDisguiseBaiduClient

func (b *BaiduApi) DownFileDisguiseBaiduClient(dLink string) (opts *rest.Opts, err error)

Disguise as a Baidu client.can down all file but will be limit speed.

func (*BaiduApi) GetDownloadUrl

func (b *BaiduApi) GetDownloadUrl(fsid string) (opts *rest.Opts, err error)

Disguise as a Baidu client.can down all file but will be limit speed.

func (*BaiduApi) GetFileMetas

func (b *BaiduApi) GetFileMetas(path []string, dlink bool, text bool) (opts *rest.Opts, err error)

func (*BaiduApi) GetQuotaInfo

func (b *BaiduApi) GetQuotaInfo() (opts *rest.Opts, err error)

func (*BaiduApi) GetUserInfo

func (b *BaiduApi) GetUserInfo() (opts *rest.Opts, err error)

func (*BaiduApi) ListDirFiles

func (b *BaiduApi) ListDirFiles(cursor string) (opts *rest.Opts, err error)

ListDirFiles order default time , desc default true ,showEmpty default false ,page begin from 1,num default 100

func (*BaiduApi) MoveOrCopyDirsOrFiles

func (b *BaiduApi) MoveOrCopyDirsOrFiles(fileList []FileManagerParam, async int, operate Operate) (opts *rest.Opts, err error)

MoveOrCopyDirsOrFiles Moving does not modify the fsid while copying generates a new fsid

func (*BaiduApi) Precreate

func (b *BaiduApi) Precreate(path string, rapidOffsetData *RapidOffsetData, preCreateFileData *PreCreateFileData) (opts *rest.Opts, err error)

上传

func (*BaiduApi) RenameDirsOrFiles

func (b *BaiduApi) RenameDirsOrFiles(fileList []FileManagerParam, async int) (opts *rest.Opts, err error)

func (*BaiduApi) Superfile2

func (b *BaiduApi) Superfile2(path string, uploadId string, partseq int, realChunkSize int64, chunk io.Reader, options ...fs.OpenOption) (opts *rest.Opts, err error)

type BaiduResponse

type BaiduResponse struct {
	BaseBaiduResponse
	GuidInf string `json:"guid_inf"`
	Guid    int64  `json:"guid"`
}

type BaseBaiduResponse

type BaseBaiduResponse struct {
	Errno     int   `json:"errno"`
	RequestId int64 `json:"request_id"`
}

func (BaseBaiduResponse) GetErrno

func (b BaseBaiduResponse) GetErrno() int

type BaseItem

type BaseItem struct {
	FsID           int64  `json:"fs_id"`
	Path           string `json:"path"`
	Md5            string `json:"md5"`
	FromType       int32  `json:"from_type"`
	ServerMd5      string `json:"server_md5"`
	Size           int64  `json:"size"`
	Category       int    `json:"category"`
	ShootTime      int64  `json:"shoot_time"`
	Ctime          int64  `json:"ctime"`
	Mtime          int64  `json:"mtime"`
	Errno          int32  `json:"errno"`
	IsDir          int32  `json:"isdir"`
	ServerFilename string `json:"server_filename"`
}

type CreateVO

type CreateVO struct {
	BaseBaiduResponse
	ReturnType int       `json:"return_type"` //不可靠,可能没有这个字段
	Data       *BaseItem `json:"data"`
}

type DownloadVO

type DownloadVO struct {
	BaseBaiduResponse
	Dlink string `json:"dlink"`
}

type FileManagerParam

type FileManagerParam struct {
	Path    string `json:"path,omitempty"`
	NewName string `json:"newname,omitempty"`
	Dest    string `json:"dest,omitempty"`
	Ondup   string `json:"ondup,omitempty"`
}

type FragmentVO

type FragmentVO struct {
	Md5       string `json:"md5"`
	Partseq   string `json:"partseq"`
	RequestId int64  `json:"request_id"`
	UploadId  int32  `json:"uploadid"`
}

func (FragmentVO) GetErrno

func (b FragmentVO) GetErrno() int

type InfoResponse

type InfoResponse struct {
	BaiduResponse
	Info []*Item `json:"info"`
}

type Item

type Item struct {
	FsID          int64     `json:"fsid"`
	Path          string    `json:"path"`
	Md5           string    `json:"md5"`
	ServerMd5     string    `json:"server_md5"`
	Size          int64     `json:"size"`
	Category      int       `json:"category"`
	Status        int       `json:"status"`
	ShootTime     int64     `json:"shoot_time"`
	TaskStatus    int       `json:"task_status"`
	Ctime         int64     `json:"ctime"`
	Mtime         int64     `json:"mtime"`
	ExtStatus     int       `json:"ext_status"`
	Flag          int       `json:"flag"`
	CollectStatus int       `json:"collect_status"`
	ThumburlList  []*string `json:"thumburl"`
	ThumburlStr   string    `json:"thumburl1"`

	Errno int `json:"errno"`
}

type ListResponse

type ListResponse struct {
	BaseBaiduResponse
	HasMore int32   `json:"has_more"`
	Cursor  string  `json:"cursor"`
	List    []*Item `json:"list"`
}

type Operate

type Operate string

type OrderType

type OrderType string

type PreCreateFileData

type PreCreateFileData struct {
	Size       int64    `schema:"size"`
	BlockList  []string `schema:"-"`
	ContentMd5 string   `schema:"content-md5"`
	SliceMd5   string   `schema:"slice-md5"`
	LocalCtime int64    `schema:"local_ctime,omitempty"`
	LocalMtime int64    `schema:"local_mtime,omitempty"`
}

type PreCreateVO

type PreCreateVO struct {
	BaseBaiduResponse
	Path       string           `json:"path"` //return_type为1时 才会有这一项
	ReturnType int              `json:"return_type"`
	BlockList  []fs.StringValue `json:"block_list"` //return_type为1时 才会有这一项
	Data       *BaseItem        `json:"data"`       //return_type为2时 才会有这一项
	UploadId   string           `json:"uploadid"`   //return_type为1时 才会有这一项
}

type QuotaInfoResponse

type QuotaInfoResponse struct {
	BaseBaiduResponse
	Quota     int64 `json:"quota"`
	Used      int64 `json:"used"`
	IsUnlimit int   `json:"is_unlimit"`
}

type RapidOffsetData

type RapidOffsetData struct {
	DataTime int64 `schema:"data_time,omitempty"`
	//DataLength  int    `schema:"data_length,omitempty"`
	DataOffset  int64  `schema:"data_offset,omitempty"`
	DataContent string `schema:"data_content,omitempty"`
}

type UserInfo

type UserInfo struct {
	YouaId           string `json:"youa_id"`
	Nickname         string `json:"nickname"`
	Photo            string `json:"photo"`
	Ctime            int64  `json:"ctime"`
	SetNickname      int32  `json:"set_nickname"`
	IsAdmin          int32  `json:"is_admin"`
	PrivateStatus    int32  `json:"private_status"`
	SupportRaw       int32  `json:"support_raw"`
	UsedInfiniteCode string `json:"used_infinite_code"`
	IsDefNickname    int32  `json:"is_def_nickname"`
	IsNew            int32  `json:"is_new"`
	IsNewOfCurApp    int32  `json:"is_new_of_cur_app"`
	BdUn             string `json:"bd_un"`
	UserAuthState    int32  `json:"user_auth_state"`
}

type UserInfoResponse

type UserInfoResponse struct {
	BaseBaiduResponse
	*UserInfo
}

Jump to

Keyboard shortcuts

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