cache

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCache

type TCache[K comparable, V interface{}] interface {
	Has(key K) bool
	Get(key K) (V, bool)
	Set(key K, value V)
	Del(key K)
	Keys() []K
	Flush()
}

type TCacheReplace added in v0.4.7

type TCacheReplace[K comparable, V interface{}] interface {
	TCache[K, V]
	Replace(data map[K]V)
}

func NewWithReplace added in v0.4.7

func NewWithReplace[K comparable, V any]() TCacheReplace[K, V]

type TCacheTTL added in v0.4.7

type TCacheTTL[K comparable, V interface{}] interface {
	TCache[K, V]
	SetWithTTL(key K, value V, ttl time.Time)
}

func NewWithTTL

func NewWithTTL[K comparable, V any](ctx context.Context, ttl time.Duration) TCacheTTL[K, V]

Jump to

Keyboard shortcuts

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