cache

package
v0.0.0-...-31ad618 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache *cacher

Functions

This section is empty.

Types

type Data

type Data interface {
	Set(...interface{}) error
	Get() Data
}

type Generic

type Generic[K comparable, T any] struct {
	sync.Mutex
	list.List[tracer[K, T]]
	// contains filtered or unexported fields
}

func NewGeneric

func NewGeneric[K comparable, T any](zero T, expireAfter time.Duration, maxLifeTime time.Duration) *Generic[K, T]

func (*Generic[K, T]) Del

func (c *Generic[K, T]) Del(key K)

func (*Generic[K, T]) GC

func (c *Generic[K, T]) GC(ctx context.Context)

func (*Generic[K, T]) Get

func (c *Generic[K, T]) Get(key K) (T, bool)

func (*Generic[K, T]) Set

func (c *Generic[K, T]) Set(key K, value T)

type Identifier

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

Jump to

Keyboard shortcuts

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