Documentation
¶
Index ¶
- func GetBlacklistKey(license string) string
- type Jwt
- func (g *Jwt) Cancellation(license string) error
- func (g *Jwt) ExpiresAt(license string) int64
- func (g *Jwt) GetLicense(uType guard.UserType, uid int64) ([]string, error)
- func (g *Jwt) IssuerAt(license string) int64
- func (g *Jwt) License(user *guard.User) (string, error)
- func (g *Jwt) Provide(ctx context.Context) interface{}
- func (g *Jwt) Verify(license string) (*guard.User, error)
- type Option
- type Options
- type RedisBlacklist
- type SigningMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlacklistKey ¶
Types ¶
type Jwt ¶
type Jwt struct {
// contains filtered or unexported fields
}
func (*Jwt) Cancellation ¶
func (*Jwt) GetLicense ¶
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
}
func (*RedisBlacklist) Black ¶
func (rbl *RedisBlacklist) Black(license string, ttl time.Duration) error
func (*RedisBlacklist) IsBlacked ¶
func (rbl *RedisBlacklist) IsBlacked(license string) bool
func (*RedisBlacklist) Provide ¶
func (rbl *RedisBlacklist) Provide(ctx context.Context) interface{}
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.