Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("credential not found")
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
Get(key string) ([]byte, error)
Set(key string, value []byte) error
Delete(key string) error
}
func NewFileBackend ¶
NewFileBackend stores each opaque credential key in its own private file. The key is hashed instead of normalized so character replacement cannot collapse distinct profile names to the same filesystem name.
func NewNativeBackendForRoot ¶ added in v0.1.9
NewNativeBackendForRoot 在应用根目录内保存 Linux ProxyCommand 主机密钥, 供 WSL 与无桌面环境使用,不依赖桌面 Keyring。
type Repository ¶
type Repository struct {
Backend Backend
}
func (Repository) Delete ¶
func (r Repository) Delete(profile string) error
type Token ¶
type Token struct {
LoginID string `json:"login_id,omitempty"`
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type,omitempty"`
ClientID string `json:"client_id"`
Site string `json:"site"`
ExpiresAt time.Time `json:"expires_at"`
RefreshedAt time.Time `json:"refreshed_at"`
}
Token 保存于私有凭据文件,不得写入普通配置或日志。