cache

package
v0.0.0-...-905232f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

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 MemcacheCacher

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

MemcacheCacher represents a memcache cache adapter implementation.

func (*MemcacheCacher) Decr

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

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

func (*MemcacheCacher) Delete

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

Delete deletes cached value by given key.

func (*MemcacheCacher) Flush

func (c *MemcacheCacher) Flush() error

Flush deletes all cached data.

func (*MemcacheCacher) Get

func (c *MemcacheCacher) Get(key string) interface{}

Get gets cached value by given key.

func (*MemcacheCacher) Incr

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

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

func (*MemcacheCacher) IsExist

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

IsExist returns true if cached value exists.

func (*MemcacheCacher) Put

func (c *MemcacheCacher) Put(key string, val interface{}, expire int64) error

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

func (*MemcacheCacher) StartAndGC

func (c *MemcacheCacher) 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