token

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package token provides token caching functionality for security module

Package token provides token caching functionality for security module

Index

Constants

View Source
const (
	CacheAccess  = "security:token:access"
	CacheRefresh = "security:token:refresh"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStorage

type CacheStorage 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
}

CacheStorage is the interface for caching the Authenticator token.

func New

func New(ss ...StorageOption) CacheStorage

New creates a new CacheStorage instance

type StorageOption

type StorageOption = func(*tokenCacheStorage)

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