Documentation
¶
Index ¶
- type Logger
- func (l *Logger) DeleteTokenFromCache(token gojwttoken.Token, id int64)
- func (l *Logger) DeleteTokenFromCacheFailed(err error)
- func (l *Logger) GetTokenFromCache(token gojwttoken.Token, id int64)
- func (l *Logger) GetTokenFromCacheFailed(err error)
- func (l *Logger) SetTokenToCache(token gojwttoken.Token, id int64)
- func (l *Logger) SetTokenToCacheFailed(err error)
- 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 Logger ¶ added in v0.4.3
type Logger struct {
// contains filtered or unexported fields
}
Logger is the cache token validator logger
func NewLogger ¶ added in v0.4.3
func NewLogger(header string, modeLogger gologgermode.Logger) (*Logger, error)
NewLogger creates a new cache token validator logger
func (*Logger) DeleteTokenFromCache ¶ added in v0.4.3
func (l *Logger) DeleteTokenFromCache(token gojwttoken.Token, id int64)
DeleteTokenFromCache logs the delete token from cache event
func (*Logger) DeleteTokenFromCacheFailed ¶ added in v0.4.3
DeleteTokenFromCacheFailed logs the delete token from cache failed event
func (*Logger) GetTokenFromCache ¶ added in v0.4.3
func (l *Logger) GetTokenFromCache(token gojwttoken.Token, id int64)
GetTokenFromCache logs the get token from cache event
func (*Logger) GetTokenFromCacheFailed ¶ added in v0.4.3
GetTokenFromCacheFailed logs the get token from cache failed event
func (*Logger) SetTokenToCache ¶ added in v0.4.3
func (l *Logger) SetTokenToCache(token gojwttoken.Token, id int64)
SetTokenToCache logs the set token to cache event
func (*Logger) SetTokenToCacheFailed ¶ added in v0.4.3
SetTokenToCacheFailed logs the set token to cache failed event
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