types

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AuthRoute       = "/oauth/2.0/authorize"
	TokenRoute      = "/oauth/2.0/token"
	FileRoute       = "/rest/2.0/xpan/file"
	MultimediaRoute = "/rest/2.0/xpan/multimedia"
	NasRoute        = "/rest/2.0/xpan/nas"
	QuotaRoute      = "/api/quota"
	UploadRoute     = "/rest/2.0/pcs/file"
	SuperFileRoute  = "/rest/2.0/pcs/superfile2"
)

Variables

View Source
var (
	ClientId     string
	ClientSecret string
	RedirectUri  = "oob"
	AccessToken  string
	RefreshToken string
	AuthBaseURL  = "https://openapi.baidu.com"
	PanBaseURL   = "https://pan.baidu.com"
	PCSBaseURL   = "https://d.pcs.baidu.com"
)

Functions

func GetReqParams

func GetReqParams(req any) (query string, body io.Reader, file io.Reader)

Types

type BoolInt

type BoolInt int
const (
	BoolIntFalse BoolInt = 0
	BoolIntTrue  BoolInt = 1
)

type CreateMode

type CreateMode int
const (
	CreateModeUserUpload      CreateMode = 1 // 手动上传
	CreateModeUserMultiUpload CreateMode = 2 // 批量上传
	CreateModeAutoBackupFile  CreateMode = 3 // 文件自动备份
	CreateModeAutoBackupPhoto CreateMode = 4 // 相册自动备份
	CreateModeAutoBackupVideo CreateMode = 5 // 视频自动备份
)

type Error

type Error struct {
	ErrorCode    int    `json:"error_code"`
	ErrorMsg     string `json:"error_msg"`
	AuthError    string `json:"error"`
	AuthErrorMsg string `json:"error_description"`
	Errno        int    `json:"errno"`
	ErrMsg       string `json:"errmsg"`
	RequestId    string `json:"request_id"`
}

func (Error) Error

func (e Error) Error() string

func (Error) IsError

func (e Error) IsError() bool

type FileCategory

type FileCategory int

1 视频、2 音频、3 图片、4 文档、5 应用、6 其他、7 种子

const (
	FileCategoryVideo    FileCategory = 1
	FileCategoryAudio    FileCategory = 2
	FileCategoryImage    FileCategory = 3
	FileCategoryDocument FileCategory = 4
	FileCategoryApp      FileCategory = 5
	FileCategoryOther    FileCategory = 6
	FileCategoryTorrent  FileCategory = 7
)

type FileCreateRType

type FileCreateRType int
const (
	FileCreateRTypePathRename          FileCreateRType = 1
	FileCreateRTypePathBlockListRename FileCreateRType = 2
	FileCreateRTypePathMove            FileCreateRType = 3
)

type ListOrder

type ListOrder string
const (
	ListOrderName ListOrder = "name" // 按文件名称排序
	ListOrderTime ListOrder = "time" // 按文件修改时间排序
	ListOrderSize ListOrder = "size" // 按文件大小排序。
)

type OndupMode

type OndupMode string
const (
	OndupModeFail      OndupMode = "fail"      //直接返回失败
	OndupModeNewcopy   OndupMode = "newcopy"   // 重命名文件
	OndupModeOverwrite OndupMode = "overwrite" // 覆盖同名文件
	OndupModeSkip      OndupMode = "skip"      // 跳过
)

type SizeB

type SizeB int64

func (SizeB) ToGB

func (s SizeB) ToGB() SizeGB

func (SizeB) ToKB

func (s SizeB) ToKB() SizeKB

func (SizeB) ToMB

func (s SizeB) ToMB() SizeMB

func (SizeB) ToPB

func (s SizeB) ToPB() SizePB

func (SizeB) ToTB

func (s SizeB) ToTB() SizeTB

type SizeGB

type SizeGB int64

func (SizeGB) ToB

func (s SizeGB) ToB() SizeB

SizeGB 转换为其他单位

func (SizeGB) ToKB

func (s SizeGB) ToKB() SizeKB

func (SizeGB) ToMB

func (s SizeGB) ToMB() SizeMB

func (SizeGB) ToPB

func (s SizeGB) ToPB() SizePB

func (SizeGB) ToTB

func (s SizeGB) ToTB() SizeTB

type SizeKB

type SizeKB int64

func (SizeKB) ToB

func (s SizeKB) ToB() SizeB

SizeKB 转换为其他单位

func (SizeKB) ToGB

func (s SizeKB) ToGB() SizeGB

func (SizeKB) ToMB

func (s SizeKB) ToMB() SizeMB

func (SizeKB) ToPB

func (s SizeKB) ToPB() SizePB

func (SizeKB) ToTB

func (s SizeKB) ToTB() SizeTB

type SizeMB

type SizeMB int64

func (SizeMB) ToB

func (s SizeMB) ToB() SizeB

SizeMB 转换为其他单位

func (SizeMB) ToGB

func (s SizeMB) ToGB() SizeGB

func (SizeMB) ToKB

func (s SizeMB) ToKB() SizeKB

func (SizeMB) ToPB

func (s SizeMB) ToPB() SizePB

func (SizeMB) ToTB

func (s SizeMB) ToTB() SizeTB

type SizePB

type SizePB int64

func (SizePB) ToB

func (s SizePB) ToB() SizeB

SizePB 转换为其他单位

func (SizePB) ToGB

func (s SizePB) ToGB() SizeGB

func (SizePB) ToKB

func (s SizePB) ToKB() SizeKB

func (SizePB) ToMB

func (s SizePB) ToMB() SizeMB

func (SizePB) ToTB

func (s SizePB) ToTB() SizeTB

type SizeTB

type SizeTB int64

func (SizeTB) ToB

func (s SizeTB) ToB() SizeB

SizeTB 转换为其他单位

func (SizeTB) ToGB

func (s SizeTB) ToGB() SizeGB

func (SizeTB) ToKB

func (s SizeTB) ToKB() SizeKB

func (SizeTB) ToMB

func (s SizeTB) ToMB() SizeMB

func (SizeTB) ToPB

func (s SizeTB) ToPB() SizePB

type Time

type Time int64

func (Time) String

func (t Time) String() string

func (Time) Time

func (t Time) Time() time.Time

func (Time) Unix

func (t Time) Unix() int64

type VipType

type VipType int
const (
	VipTypeUser     VipType = 0
	VipTypeVip      VipType = 1
	VipTypeSuperVip VipType = 2
)

Jump to

Keyboard shortcuts

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