first commit

This commit is contained in:
kenneth
2023-11-28 09:50:42 +00:00
parent d940668996
commit 5a01af92af
33 changed files with 1939 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
package token
import (
"time"
)
// Maker 管理token的接口定义
type Maker interface {
// CreateToken 根据用户名和时间创建一个新的token
CreateToken(id string, username string, duration time.Duration) (string, *Payload, error)
// VerifyToken 校验token是否正确
VerifyToken(token string) (*Payload, error)
}