mirror of
https://github.com/weloe/token-go.git
synced 2025-10-05 15:36:50 +08:00
feat: add checkId getId api and SecondAuth api
This commit is contained in:
@@ -37,8 +37,10 @@ type IEnforcer interface {
|
||||
IsLoginByToken(token string) (bool, error)
|
||||
IsLoginById(id string) (bool, error)
|
||||
CheckLogin(ctx ctx.Context) error
|
||||
CheckLoginByToken(token string) error
|
||||
|
||||
GetLoginId(ctx ctx.Context) (string, error)
|
||||
GetLoginIdByToken(token string) (string, error)
|
||||
GetIdByToken(token string) string
|
||||
GetLoginCount(id string) int
|
||||
|
||||
@@ -52,6 +54,12 @@ type IEnforcer interface {
|
||||
GetBannedLevel(id string, service string) (int64, error)
|
||||
GetBannedTime(id string, service string) int64
|
||||
|
||||
// Second auth api
|
||||
OpenSafe(token string, service string, time int64) error
|
||||
IsSafe(token string, service string) bool
|
||||
GetSafeTime(token string, service string) int64
|
||||
CloseSafe(token string, service string) error
|
||||
|
||||
GetRequestToken(ctx ctx.Context) string
|
||||
AddTokenGenerateFun(tokenStyle string, f model.GenerateFunc) error
|
||||
|
||||
|
Reference in New Issue
Block a user