Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blacklist ¶
type Blacklist interface { Black(string, time.Duration) error // 将牌照加入黑名单 Checklist(string) (bool, error) // 检查牌照是否在黑名单列表中 }
Blacklist 黑名单列表
type Guard ¶
type Guard interface { License(*User) (string, error) // 发行牌照 GetLicense(Type, int64) ([]string, error) Verify(string) (*User, error) // 验证牌照 Cancellation(string) error // 吊销牌照 ExpiresAt(string) int64 // 获取牌照有效时间 IssuerAt(string) int64 // 获取牌照发行时间 }
Guard API 入口守卫
type Store ¶
type Store interface { GetTokenDetail(license string) (*TokenDetail, error) // 通过 token 获取 token 的详细信息 GetTokenByUid(uType Type, uid int64) (*UserToken, error) // 通过用户类型及用户的 uid 获取用户的 token 列表 Save(license string, tokenDetail *TokenDetail) error // 保存用户的 token Expired(license string) error // 将用户 token 过期 Exist(license string) bool // 检查 token 是否存在 }
type TokenDetail ¶ added in v1.6.2
Click to show internal directories.
Click to hide internal directories.