memcache

package
v0.0.0-...-1cfe172 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() cache.Cacher

New create a cache instance of memcache

Types

type Memcache

type Memcache struct {
	Name   string
	Prefix string
	// contains filtered or unexported fields
}

Memcache implement a memcache cache adapter for cacher

func (*Memcache) Decr

func (c *Memcache) Decr(key string) (int64, error)

Decr decreases cached int-type value by given key as a counter if key not exist, return errors

func (*Memcache) Delete

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

Delete delete cached data by given key

func (*Memcache) Exist

func (c *Memcache) Exist(key string) bool

Exist return true if value cached by given key

func (*Memcache) Flush

func (c *Memcache) Flush() error

Flush flush cacher

func (*Memcache) Get

func (c *Memcache) Get(key string, out interface{}) error

Get returns value by given key

func (*Memcache) Incr

func (c *Memcache) Incr(key string) (int64, error)

Incr increases cached int-type value by given key as a counter if key not exist, before increase set value with zero

func (*Memcache) Set

func (c *Memcache) Set(key string, v interface{}, ttl int64) error

Set cache value by given key, cache ttl second

func (*Memcache) Start

func (c *Memcache) Start(o cache.Options) error

Start new a cacher and start service

Jump to

Keyboard shortcuts

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