memcache

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[M any](opt Options) cacher.Store[M]

Types

type Memcache

type Memcache[M any] struct {
	CompressAlg cacher.CompressAlg
	// contains filtered or unexported fields
}

func (*Memcache[M]) Clear

func (m *Memcache[M]) Clear(ctx context.Context) error

func (*Memcache[M]) Delete

func (m *Memcache[M]) Delete(ctx context.Context, key string) error

func (*Memcache[M]) Get

func (m *Memcache[M]) Get(ctx context.Context, key string) (M, error)

func (*Memcache[M]) GetHooks

func (m *Memcache[M]) GetHooks() []cacher.Hook

func (*Memcache[M]) MGet

func (m *Memcache[M]) MGet(ctx context.Context, keys ...string) ([]M, error)

func (*Memcache[M]) MSet

func (m *Memcache[M]) MSet(ctx context.Context, data ...cacher.Params[M]) error

func (*Memcache[M]) Set

func (m *Memcache[M]) Set(ctx context.Context, key string, val M, opts ...cacher.StoreOptions) error

func (*Memcache[M]) SetOptions

func (m *Memcache[M]) SetOptions(opt cacher.StoreOptions)

type Options

type Options struct {
	Addr        []string
	Ttl         time.Duration
	Hooks       []cacher.Hook
	CompressAlg cacher.CompressAlg
}

Jump to

Keyboard shortcuts

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