Versions in this module Expand all Collapse all v1 v1.0.1 Mar 31, 2023 v1.0.0 Mar 31, 2023 Changes in this version + var ErrInvalidKid = errors.New("invalid kid") + var ErrUnsetKid = errors.New("unset kid") + type Auth struct + func NewWithClock[CustomClaims any](clock Clock, expireSeconds int, keys ...*Key) *Auth[CustomClaims] + func New[CustomClaims any](expireSeconds int, keys ...*Key) *Auth[CustomClaims] + func (auth *Auth[CustomClaims]) GenerateToken(customClaims *CustomClaims) (token string, expiresAt time.Time, err error) + func (auth *Auth[CustomClaims]) ParseToken(tokenString string) (*CustomClaims, error) + type Clock interface + Now func() time.Time + type Key struct + Kid string + SigningKey any + SigningMethod jwt.SigningMethod + VerifyingKey any + func NewECDSAKey(kid string, key *ecdsa.PrivateKey, signingMethod *jwt.SigningMethodECDSA) *Key + func NewHMACKey(kid string, key []byte, signingMethod *jwt.SigningMethodHMAC) *Key + func NewRSAKey(kid string, key *rsa.PrivateKey, signingMethod *jwt.SigningMethodRSA) *Key + func (key *Key) Deprecated() *Key + type TimeClock struct + func (t TimeClock) Now() time.Time