Documentation
¶
Index ¶
- type TokenValidator
- type TokenValidatorService
- func (t *TokenValidatorService) Delete(token gojwttoken.Token, id string) error
- func (t *TokenValidatorService) Get(token gojwttoken.Token, id string) (interface{}, bool)
- func (t *TokenValidatorService) GetKey(token gojwttoken.Token, id string) (string, error)
- func (t *TokenValidatorService) Has(token gojwttoken.Token, id string) (bool, error)
- func (t *TokenValidatorService) Set(token gojwttoken.Token, id string, value interface{}, expiresAt time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenValidator ¶
type TokenValidator interface {
Set(
token gojwttoken.Token,
id string,
value interface{},
expiresAt time.Time,
) error
Has(token gojwttoken.Token, id string) (bool, error)
Get(token gojwttoken.Token, id string) (interface{}, bool)
Delete(token gojwttoken.Token, id string) error
}
TokenValidator interface
type TokenValidatorService ¶
type TokenValidatorService struct {
gocachetimed.Cache
}
TokenValidatorService struct
func NewTokenValidatorService ¶
func NewTokenValidatorService() *TokenValidatorService
NewTokenValidatorService creates a new token validator service
func (*TokenValidatorService) Delete ¶
func (t *TokenValidatorService) Delete( token gojwttoken.Token, id string, ) error
Delete deletes a token from the cache
func (*TokenValidatorService) Get ¶
func (t *TokenValidatorService) Get( token gojwttoken.Token, id string, ) (interface{}, bool)
Get gets a token from the cache
func (*TokenValidatorService) GetKey ¶ added in v0.4.2
func (t *TokenValidatorService) GetKey( token gojwttoken.Token, id string, ) (string, error)
GetKey gets the key for the cache
func (*TokenValidatorService) Has ¶
func (t *TokenValidatorService) Has( token gojwttoken.Token, id string, ) (bool, error)
Has checks if a token exists in the cache
func (*TokenValidatorService) Set ¶
func (t *TokenValidatorService) Set( token gojwttoken.Token, id string, value interface{}, expiresAt time.Time, ) error
Set sets a token in the cache
Click to show internal directories.
Click to hide internal directories.