Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrSignToken = errors.New("fail when sign token")
)
Functions ¶
func ClaimsFactory ¶
func ClaimsFactory() jwt.Claims
Types ¶
type Claims ¶
type Claims struct { jwt.StandardClaims SubjectID uuid.UUID `json:"subId,omitempty"` }
type JWTStrategyConfig ¶
type JWTStrategyConfig struct { // Key for token signing. Key []byte // Token time life. Ttl time.Duration // Token audience. Audience string // Token Issuer. Issuer string }
JWTStrategyConfig is config for jwt service.
type ServiceJwt ¶
type ServiceJwt struct {
// contains filtered or unexported fields
}
ServiceJwt is jwt implementation.
func NewJwtService ¶
func NewJwtService(cfg JWTStrategyConfig, clock clock.Clock) *ServiceJwt
NewJwtService creates jst service.
Click to show internal directories.
Click to hide internal directories.