caches

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stack = vars.SetOnce[[]cache.Cache]{}

Functions

func Delete

func Delete(ctx context.Context, keys ...string) (err error)

Delete removes the keys.

func Get

func Get(ctx context.Context, key string) (entry []byte, err error)

Get reads entry for the given key, it returns an ErrEntryNotFound when no entry exists for the given key.

func Iterate

func Iterate(ctx context.Context, m cache.EntryKeyMatcher, a cache.EntryAccessor) (err error)

Iterate iterates all entries of the whole cache, breaks with none nil error, do not do time-expensive callback during iteration.

func List

func List(ctx context.Context, keys ...string) (entries [][]byte, err error)

List reads entries for the given key list, it returns an entry list with nil value when no entry exists for the given key.

func Set

func Set(ctx context.Context, key string, entry []byte) (err error)

Set saves entry with the given key.

func Underlay

func Underlay[T any]() (T, error)

Underlay returns the underlay client with the given generic, e.g. process cache implements with *bigcache.BigCache, remote cache implements with redis.UniversalClient. DO NOT close the underlay client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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