nscache

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 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 NSCache

type NSCache[S any] struct {
	// contains filtered or unexported fields
}

NSCache is a namespaced cache wrapper.

func NewNSCache

func NewNSCache[S any](namespace string, cache cache.Cache[S]) *NSCache[S]

NewNSCache creates a new namespaced cache.

func (*NSCache[S]) Close

func (n *NSCache[S]) Close() error

func (*NSCache[S]) Del

func (n *NSCache[S]) Del(ctx context.Context, key string) error

func (*NSCache[S]) DelAll

func (n *NSCache[S]) DelAll(ctx context.Context) error

func (*NSCache[S]) Exists

func (n *NSCache[S]) Exists(ctx context.Context, key string) (bool, error)

func (*NSCache[S]) Get

func (n *NSCache[S]) Get(ctx context.Context, key string) (S, bool, error)

func (*NSCache[S]) GetDel

func (n *NSCache[S]) GetDel(ctx context.Context, key string) (S, bool, error)

func (*NSCache[S]) MultiDel

func (n *NSCache[S]) MultiDel(ctx context.Context, keys []string) error

func (*NSCache[S]) MultiGet

func (n *NSCache[S]) MultiGet(ctx context.Context, keys []string) (map[string]S, error)

func (*NSCache[S]) MultiSet

func (n *NSCache[S]) MultiSet(ctx context.Context, valMap map[string]S) error

func (*NSCache[S]) MultiSetWithTTL

func (n *NSCache[S]) MultiSetWithTTL(ctx context.Context, valMap map[string]S, expiration time.Duration) error

func (*NSCache[S]) Set

func (n *NSCache[S]) Set(ctx context.Context, key string, val S) error

func (*NSCache[S]) SetWithTTL

func (n *NSCache[S]) SetWithTTL(ctx context.Context, key string, val S, expiration time.Duration) error

Jump to

Keyboard shortcuts

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