pcsconfig

package
v0.0.0-...-a2fe341 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config 配置信息, 由外部调用
	Config = new(PCSConfig)

	// ActiveBaiduUser 当前百度帐号
	ActiveBaiduUser *Baidu

	// SaveDir 保存文件的目录
	SaveDir = "download/"
)

Functions

func CheckFileExist

func CheckFileExist(path string) bool

CheckFileExist 检查本地文件是否与网盘的文件重名

func GetSavePath

func GetSavePath(path string) string

GetSavePath 根据提供的网盘文件路径 path, 返回本地储存路径

func GetUserNameByUID

func GetUserNameByUID(uid uint64) (username string, err error)

func Init

func Init()

Init 初始化配置

func Reload

func Reload() error

Reload 从配置文件重载更新 Config

func UpdateActiveBaiduUser

func UpdateActiveBaiduUser() error

UpdateActiveBaiduUser 更新 当前百度帐号

Types

type Baidu

type Baidu struct {
	UID   uint64 `json:"uid"`
	Name  string `json:"name"`
	BDUSS string `json:"bduss"`

	Workdir string `json:"workdir"`
}

func NewWithBDUSS

func NewWithBDUSS(bduss string) (*Baidu, error)

NewWithBDUSS 检测BDUSS有效性, 同时获取百度详细信息

type PCSConfig

type PCSConfig struct {
	BaiduActiveUID uint64   `json:"baidu_active_uid"`
	BaiduUserList  []*Baidu `json:"baidu_user_list"`
	MaxParallel    int      `json:"max_parallel"`
}

PCSConfig 配置详情

func (*PCSConfig) CheckUIDExist

func (c *PCSConfig) CheckUIDExist(uid uint64) bool

func (*PCSConfig) DeleteBaiduUserByUID

func (c *PCSConfig) DeleteBaiduUserByUID(uid uint64) bool

func (*PCSConfig) GetAllBaiduUser

func (c *PCSConfig) GetAllBaiduUser() string

func (*PCSConfig) GetBaiduUserByUID

func (c *PCSConfig) GetBaiduUserByUID(uid uint64) (*Baidu, error)

func (*PCSConfig) Save

func (c *PCSConfig) Save() error

Save 保存配置信息到配置文件, 并重载配置

func (*PCSConfig) SetBDUSS

func (c *PCSConfig) SetBDUSS(bduss string) (username string, err error)

SetBDUSS 设置百度 bduss 并保存

Jump to

Keyboard shortcuts

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