memcache

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memcache

type Memcache struct {
	// contains filtered or unexported fields
}

Memcache implements Cache interface for memcache memory storage

func New

func New(client *memcache.Client) *Memcache

New creates new Memcache implementation

func (*Memcache) Del

func (m *Memcache) Del(ctx context.Context, keys ...string) error

Del delete keys

func (*Memcache) Get

func (m *Memcache) Get(ctx context.Context, key string, dest interface{}) error

Get fetch key value and then unmarshal it into dest. Will return gogox error with code CodeNotFound if key not found.

func (*Memcache) Set

func (m *Memcache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Set set value for key using value json marshal result. Expiration is set accordingly

Jump to

Keyboard shortcuts

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