cache

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InMemoryDriver string = "inmemory"
	RedisDriver    string = "redis"
)

Variables

View Source
var ErrNotFound error = fmt.Errorf("item not found in cache")

Functions

This section is empty.

Types

type AuthorizationState added in v0.1.1

type AuthorizationState struct {
	RedirectURI                    string
	AuthorizationVerificationToken string
}

type MemoryCache

type MemoryCache struct {
	// contains filtered or unexported fields
}

func NewInMemoryCache

func NewInMemoryCache(defaultExpiration time.Duration) *MemoryCache

func (*MemoryCache) DeleteState added in v0.1.1

func (i *MemoryCache) DeleteState(state string) error

func (*MemoryCache) GetRedirectURI

func (i *MemoryCache) GetRedirectURI(state string) (AuthorizationState, error)

func (*MemoryCache) SetRedirectURI

func (i *MemoryCache) SetRedirectURI(state string, authZState AuthorizationState) error

type RedisCache

type RedisCache struct {
	// contains filtered or unexported fields
}

func NewRedisCache

func NewRedisCache(redisCfg RedisConfig, defaultExpiration time.Duration) (*RedisCache, error)

func (*RedisCache) DeleteState added in v0.1.1

func (r *RedisCache) DeleteState(state string) error

func (*RedisCache) GetRedirectURI

func (r *RedisCache) GetRedirectURI(state string) (AuthorizationState, error)

func (*RedisCache) SetRedirectURI

func (r *RedisCache) SetRedirectURI(state string, authZState AuthorizationState) error

type RedisConfig

type RedisConfig struct {
	Address  string
	Password string
	DB       int
}

Jump to

Keyboard shortcuts

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