Documentation ¶
Index ¶
- Constants
- Variables
- func GetConfigDir() string
- type ConfigsData
- func (c *ConfigsData) ActiveUser() *Dedao
- func (c *ConfigsData) ActiveUserService() *services.Service
- func (c *ConfigsData) DeleteUser(u *User)
- func (c *ConfigsData) GetIDMap(category string, id int) (info map[string]interface{})
- func (c *ConfigsData) Init() error
- func (c *ConfigsData) LoginUserCount() int
- func (c *ConfigsData) Save() error
- func (c *ConfigsData) SetIDMap(category string, m CourseIDMap) error
- func (c *ConfigsData) SetUser(u *Dedao) (*Dedao, error)
- func (c *ConfigsData) SwitchUser(u *User) error
- type CourseIDMap
- type Dedao
- type DedaoUsers
- type User
Constants ¶
View Source
const ( // EnvConfigDir 配置路径环境变量 EnvConfigDir = "DEDAO_GO_CONFIG_DIR" // ConfigName 配置文件名 ConfigName = "config.json" )
View Source
const VERSION = "1.1.2"
VERSION version of dedao-dl
Variables ¶
View Source
var (
// BaseURL dedao url
BaseURL = "https://www.dedao.cn"
)
View Source
var ( // Instance 配置信息 全局调用 Instance = New(configFilePath) )
Functions ¶
Types ¶
type ConfigsData ¶
type ConfigsData struct { AcitveUID string DownloadPath string Users DedaoUsers CourseIDMap CourseIDMap OdobIDMap CourseIDMap EBookIDMap CourseIDMap // contains filtered or unexported fields }
ConfigsData Configs data
func (*ConfigsData) ActiveUserService ¶
func (c *ConfigsData) ActiveUserService() *services.Service
ActiveUserService user
func (*ConfigsData) GetIDMap ¶ added in v1.1.4
func (c *ConfigsData) GetIDMap(category string, id int) (info map[string]interface{})
func (*ConfigsData) LoginUserCount ¶
func (c *ConfigsData) LoginUserCount() int
LoginUserCount 登录用户数量
func (*ConfigsData) SetIDMap ¶ added in v1.1.4
func (c *ConfigsData) SetIDMap(category string, m CourseIDMap) error
SetIDMap set course id => enid map, or odob id => alias_id map
func (*ConfigsData) SetUser ¶
func (c *ConfigsData) SetUser(u *Dedao) (*Dedao, error)
SetUser set user
func (*ConfigsData) SwitchUser ¶
func (c *ConfigsData) SwitchUser(u *User) error
SwitchUser switch user
type CourseIDMap ¶ added in v1.1.4
Click to show internal directories.
Click to hide internal directories.