Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
func (*JWT) GenerateToken ¶
func (t *JWT) GenerateToken(payload interface{}, sub string, expire time.Duration) (token string, expriets int64, err error)
GenerateToken Generate new jwt token
func (*JWT) ParseToken ¶
func (t *JWT) ParseToken(token string) (*JWTClaims, error)
ParseToken Parse jwt token, return the claims
type Options ¶
type Options struct {
Expire time.Duration `yaml:"expire" default:"24h0m0s" help:"jwt expire time"`
Cert string `yaml:"cert" default:"certs/jwt/tls.crt" help:"jwt cert file"`
Key string `yaml:"key" default:"certs/jwt/tls.key" help:"jwt key file"`
IssuerAddr string `json:"issuerAddr" description:"oidc provider issuer address"`
}
func DefaultOptions ¶
func DefaultOptions() *Options
Click to show internal directories.
Click to hide internal directories.