cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cache provides token caching functionality for security module

Package cache provides token caching functionality for security module

Index

Constants

View Source
const (
	AccessKey  = "security:token:access"
	RefreshKey = "security:token:refresh"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Store stores the token with a specific expiration time
	Store(context.Context, string, time.Duration) error
	// Exist checks if the token exists
	Exist(context.Context, string) (bool, error)
	// Remove deletes the token
	Remove(context.Context, string) error
	// Close closes the storage
	Close(context.Context) error
}

Cache is the interface for caching the Authenticator token.

func New

func New(ss ...StorageOption) Cache

New creates a new Cache instance

type StorageOption

type StorageOption = func(*cacheStorage)

func WithCache

func WithCache(c storageiface.Cache) StorageOption

Jump to

Keyboard shortcuts

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