Documentation
¶
Index ¶
- Constants
- type Jwt
- func (guard *Jwt) Cancellation(license string) error
- func (guard *Jwt) ExpiresAt(license string) int64
- func (guard *Jwt) GetUser() interface{}
- func (guard *Jwt) IssuerAt(license string) int64
- func (guard *Jwt) License(user *guard.User) (string, error)
- func (guard *Jwt) Provide(ctx context.Context) interface{}
- func (guard *Jwt) Verify(license string) (*guard.User, error)
- type Option
- type Options
- type RedisBlacklist
- type SigningMethod
Constants ¶
View Source
const (
BlacklistKey = "blacklist.key.%s"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Jwt ¶
type Jwt struct { Blacklist guard.Blacklist `inject:""` User interface{} `inject:""` // contains filtered or unexported fields }
func (*Jwt) Cancellation ¶
type Option ¶
type Option func(*Options)
func WithExpire ¶
func WithIssuer ¶
func WithSigningMethod ¶
func WithSigningMethod(signMethod SigningMethod) Option
type Options ¶
type Options struct { Issuer string Expire time.Duration SigningMethod SigningMethod Key []byte }
type RedisBlacklist ¶
type RedisBlacklist struct {
// contains filtered or unexported fields
}
type SigningMethod ¶
type SigningMethod string
const ( SigningMethodSH256 SigningMethod = "sha256" SigningMethodSH384 SigningMethod = "sha384" SigningMethodSH512 SigningMethod = "sha512" )
Click to show internal directories.
Click to hide internal directories.