Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExpired = errors.New("expired") ErrInvalid = errors.New("invalid") ErrNotFound = errors.New("not found") )
predefined cache errors
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
DeleteJWT(key string) error
LoadJWT(key string) (rawJWT string, err error)
StoreJWT(key string, rawJWT string) error
}
A Cache loads and stores JWTs.
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
A LocalCache stores files in the user's cache directory.
func NewLocalCache ¶
func NewLocalCache() (*LocalCache, error)
NewLocalCache creates a new LocalCache.
func (*LocalCache) DeleteJWT ¶
func (cache *LocalCache) DeleteJWT(key string) error
DeleteJWT deletes a raw JWT from the local cache.
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
A MemoryCache stores JWTs in an in-memory map.
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
NewMemoryCache creates a new in-memory JWT cache.
func (*MemoryCache) DeleteJWT ¶
func (cache *MemoryCache) DeleteJWT(key string) error
DeleteJWT deletes a JWT from the in-memory map.
Click to show internal directories.
Click to hide internal directories.