Documentation
¶
Index ¶
- type Blocklist
- func (b *Blocklist) Connect() error
- func (b *Blocklist) Count() (int64, error)
- func (b *Blocklist) Del(key string) error
- func (b *Blocklist) Has(key string) (bool, error)
- func (b *Blocklist) InvalidateToken(token []byte, c jwt.Claims) error
- func (b *Blocklist) IsConnected() bool
- func (b *Blocklist) ValidateToken(token []byte, c jwt.Claims, err error) error
- type MysqlOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocklist ¶
type Blocklist struct {
MysqlOptions *MysqlOptions
}
Blocklist is a jwt.Blocklist backed by Redis.
func NewBlocklist ¶
func NewBlocklist() *Blocklist
NewBlocklist returns a new redis-based Blocklist. Modify its ClientOptions or ClusterOptions depending the application needs and call its Connect.
Usage:
blocklist := NewBlocklist() blocklist.ClientOptions.Addr = ... err := blocklist.Connect()
And register it:
verifier := jwt.NewVerifier(...) verifier.Blocklist = blocklist
func (*Blocklist) InvalidateToken ¶
InvalidateToken invalidates a verified JWT token.
func (*Blocklist) IsConnected ¶
IsConnected reports whether the Connect function was called.
Click to show internal directories.
Click to hide internal directories.