Documentation
¶
Overview ¶
Package auth 持久化 ~/.javdb-cli/auth.json 中的多账户认证资料。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("account not found")
ErrNotFound 表示账户查询没有匹配项。
Functions ¶
Types ¶
type Account ¶
type Account struct {
UserID int64 `json:"user_id"`
Username string `json:"username"`
Password string `json:"password"`
Token string `json:"token"`
}
Account 表示一个已保存的登录账户;密码按现有格式明文保存。
type FileStore ¶
type FileStore struct {
Path string
// contains filtered or unexported fields
}
FileStore 将文件路径与互斥提交操作绑定,供 CLI 使用。
type Store ¶
type Store struct {
DefaultUserID int64 `json:"default_user_id"`
Accounts []Account `json:"accounts"`
}
Store 是磁盘上的多账户 JSON 文档。
func (*Store) UpdateToken ¶
UpdateToken 替换指定账户的 token。
Click to show internal directories.
Click to hide internal directories.