Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type JwtManager ¶
type JwtManager interface {
Start() (err error)
Generate(*m.User, ...*time.Time) (accessToken string, err error)
Verify(string) (claims *UserClaims, err error)
SetHmacKey(hmacKey []byte)
}
JwtManager ...
func NewJwtManager ¶
func NewJwtManager(lc fx.Lifecycle, adaptors *adaptors.Adaptors) (mananger JwtManager)
NewJwtManager ...
type UserClaims ¶
type UserClaims struct {
UserId int64 `json:"i,omitempty"`
Username string `json:"n,omitempty"`
RoleName string `json:"r,omitempty"`
}
UserClaims ...
Click to show internal directories.
Click to hide internal directories.