cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout  = errors.New("cache: timeout")
	ErrNotFound = errors.New("cache: not found")
)

Functions

This section is empty.

Types

type BytesCache

type BytesCache interface {
	Get(k string) ([]byte, error)
	Set(k string, v []byte, expire int32)
}

func NewExpireCache

func NewExpireCache(maxsize uint64) BytesCache

func NewMemcached

func NewMemcached(prefix string, servers ...string) BytesCache

type ExpireCache

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

func (ExpireCache) Get

func (ec ExpireCache) Get(k string) ([]byte, error)

func (ExpireCache) Items

func (ec ExpireCache) Items() int

func (ExpireCache) Set

func (ec ExpireCache) Set(k string, v []byte, expire int32)

func (ExpireCache) Size

func (ec ExpireCache) Size() uint64

type MemcachedCache

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

func (*MemcachedCache) Get

func (m *MemcachedCache) Get(k string) ([]byte, error)

func (*MemcachedCache) Set

func (m *MemcachedCache) Set(k string, v []byte, expire int32)

func (*MemcachedCache) Timeouts

func (m *MemcachedCache) Timeouts() uint64

type NullCache

type NullCache struct{}

func (NullCache) Get

func (NullCache) Get(string) ([]byte, error)

func (NullCache) Set

func (NullCache) Set(string, []byte, int32)

Jump to

Keyboard shortcuts

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