memory

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Memory struct contains *memcache.Client

func NewCache

func NewCache() *Memory

NewCache create new memcache

func (*Memory) Delete

func (mem *Memory) Delete(key string) error

Delete delete value in memcache.

func (*Memory) Get

func (mem *Memory) Get(key string, val interface{}) error

Get return cached value

func (*Memory) IsExist

func (mem *Memory) IsExist(key string) bool

IsExist check value exists in memcache.

func (*Memory) Set

func (mem *Memory) Set(key string, val interface{}, timeout time.Duration) (err error)

Set cached value with key and expire time.

Jump to

Keyboard shortcuts

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