Help us shape the future of Go! Take the 2026 Go Developer Survey

memcache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewItem

func NewItem(key string, data []byte, expire int32) *memcache.Item

Types

type Cacher

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

Cacher represents a memcache cache adapter implementation.

func (*Cacher) Decr

func (c *Cacher) Decr(key string) error

Decr decreases cached int-type value by given key as a counter.

func (*Cacher) Delete

func (c *Cacher) Delete(key string) error

Delete deletes cached value by given key.

func (*Cacher) Flush

func (c *Cacher) Flush() error

Flush deletes all cached data.

func (*Cacher) Get

func (c *Cacher) Get(key string) any

Get gets cached value by given key.

func (*Cacher) Incr

func (c *Cacher) Incr(key string) error

Incr increases cached int-type value by given key as a counter.

func (*Cacher) IsExist

func (c *Cacher) IsExist(key string) bool

IsExist returns true if cached value exists.

func (*Cacher) Ping

func (c *Cacher) Ping() error

Ping tests if the cache is alive.

func (*Cacher) Put

func (c *Cacher) Put(key string, val any, expire int64) error

Put puts value into cache with key and expire time. If expired is 0, it lives forever.

func (*Cacher) StartAndGC

func (c *Cacher) StartAndGC(opt cache.Options) error

StartAndGC starts GC routine based on config string settings. AdapterConfig: 127.0.0.1:9090;127.0.0.1:9091

Jump to

Keyboard shortcuts

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