cache

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](maxSize int, onEvict func(T)) *Cache[T]

func (*Cache[T]) Add

func (c *Cache[T]) Add(key Key, value T)

func (*Cache[T]) Get

func (c *Cache[T]) Get(key Key) (T, bool)

func (*Cache[T]) Remove

func (c *Cache[T]) Remove(key Key)

type Key

type Key struct {
	Identity string
	// Audiences is part of the cache key because it includes the token secret's
	// namespace and name (e.g., "dopplerTokenSecret:namespace:secret-name").
	// This allows the same identity to be used in different token secrets
	// (different names or namespaces) while maintaining separate cached providers
	// for each, since each will have different audience claims in their JWTs.
	Audiences string
}

Jump to

Keyboard shortcuts

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