first commit
This commit is contained in:
14
internal/pkg/token/maker.go
Normal file
14
internal/pkg/token/maker.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user