cache

package
v1.0.47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenCache

type TokenCache struct {
	Entries map[string]*user.User `json:"entries,omitempty" xml:"entries,omitempty" yaml:"entries,omitempty"`
	// contains filtered or unexported fields
}

TokenCache contains cached tokens

func NewTokenCache

func NewTokenCache(i int) *TokenCache

NewTokenCache returns TokenCache instance.

func (*TokenCache) Add

func (c *TokenCache) Add(usr *user.User) error

Add adds a token and the associated claim to cache.

func (*TokenCache) Delete

func (c *TokenCache) Delete(token string) error

Delete removes cached token from

func (*TokenCache) Get

func (c *TokenCache) Get(token string) *user.User

Get returns User instance if the token associated with the claim exists in cache. If the token is expired, it will be removed from the cache.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL