mcache

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[K comparable, S any] struct {
	// contains filtered or unexported fields
}

func NewMapCache

func NewMapCache[S any]() *Map[string, S]

func (*Map[K, S]) Close

func (t *Map[K, S]) Close() error

func (*Map[K, S]) Count

func (t *Map[K, S]) Count() int

func (*Map[K, S]) Del

func (t *Map[K, S]) Del(ctx context.Context, key K) error

func (*Map[K, S]) DelAll

func (t *Map[K, S]) DelAll(ctx context.Context) error

func (*Map[K, S]) Exists

func (t *Map[K, S]) Exists(ctx context.Context, key K) (bool, error)

func (*Map[K, S]) Get

func (t *Map[K, S]) Get(ctx context.Context, key K) (S, bool, error)

func (*Map[K, S]) MultiDel

func (t *Map[K, S]) MultiDel(ctx context.Context, keys []K) error

func (*Map[K, S]) MultiGet

func (t *Map[K, S]) MultiGet(ctx context.Context, keys []K) (map[K]S, error)

func (*Map[K, S]) MultiSet

func (t *Map[K, S]) MultiSet(ctx context.Context, valMap map[K]S) error

func (*Map[K, S]) MultiSetWithTTL

func (t *Map[K, S]) MultiSetWithTTL(ctx context.Context, valMap map[K]S, expiration time.Duration) error

func (*Map[K, S]) Set

func (t *Map[K, S]) Set(ctx context.Context, key K, val S) error

func (*Map[K, S]) SetWithTTL

func (t *Map[K, S]) SetWithTTL(ctx context.Context, key K, val S, expiration time.Duration) error

func (*Map[K, S]) Trim

func (t *Map[K, S]) Trim()

Jump to

Keyboard shortcuts

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