holdcache

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 5 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[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache[K comparable, V any](options *Options[K, V]) *Cache[K, V]

func (*Cache[K, V]) Commit

func (c *Cache[K, V]) Commit(k K, v V)

func (*Cache[K, V]) Hold

func (c *Cache[K, V]) Hold(k K, v V, d time.Duration)

func (*Cache[K, V]) Invalidate

func (c *Cache[K, V]) Invalidate(k K)

func (*Cache[K, V]) Stop

func (c *Cache[K, V]) Stop()

type Event

type Event interface {
	// contains filtered or unexported methods
}

type Handler

type Handler[K comparable, V any] interface {
	CommitHandler(K, V)
	InvalidateHandler(K, V)
}

type Options

type Options[K comparable, V any] struct {
	Handler[K, V]

	StopBehavior StopBehavior

	LogPrefix string
	LogDebug  bool
}

type StopBehavior

type StopBehavior uint8
const (
	NoOpOnStop       StopBehavior = 0
	CommitOnStop     StopBehavior = 1
	InvalidateOnStop StopBehavior = 2
)

Jump to

Keyboard shortcuts

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