Documentation ¶
Index ¶
Constants ¶
View Source
const JWT_PAYLOAD key = "jwt-payload"
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("token is invalid") ErrExpiredToken = errors.New("token has expired") )
Functions ¶
func AppendRequestCtx ¶
Types ¶
type JwtMaker ¶
type JwtMaker struct {
// contains filtered or unexported fields
}
func NewJWTMaker ¶
func NewJWTMaker(config *common_utils.BaseConfig) (*JwtMaker, error)
func (*JwtMaker) CreateToken ¶
type Payload ¶
type Payload struct { jwt.Claims ID uuid.UUID `json:"id"` UserId uuid.UUID `json:"userId"` Email string `json:"email"` Role string `json:"role"` IssuedAt time.Time `json:"issuedAt"` ExpiredAt time.Time `json:"expiredAt"` }
func GetRequestCtx ¶
func NewPayload ¶
func NewPayload(params PayloadParams, duration time.Duration) *Payload
Click to show internal directories.
Click to hide internal directories.