cache

package
v0.0.0-...-e6af7e3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2016 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCache

func RegisterCache(name string, f CacheConstructor)

Types

type Cache

type Cache interface {
	Put(namespace, key string, data []byte) error
	Get(namespace, key string) ([]byte, error)
}

func NewCache

func NewCache(name string, config *configs.PluginConfig) (Cache, error)

func NewCocaineCache

func NewCocaineCache(config *configs.PluginConfig) (Cache, error)

func NewInMemoryCache

func NewInMemoryCache(config *configs.PluginConfig) (Cache, error)

type CacheConstructor

type CacheConstructor func(*configs.PluginConfig) (Cache, error)

type CocaineCache

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

func (*CocaineCache) Get

func (c *CocaineCache) Get(namespace, key string) ([]byte, error)

func (*CocaineCache) Put

func (c *CocaineCache) Put(namespace, key string, value []byte) error

type InMemory

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

func (*InMemory) Get

func (i *InMemory) Get(namespace, key string) ([]byte, error)

func (*InMemory) Put

func (i *InMemory) Put(namespace, key string, data []byte) error

Jump to

Keyboard shortcuts

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