cache_storages

package module
v0.0.0-...-f047ee7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MAX_IDLE     = 3
	IDLE_TIMEOUT = 180
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStorage

type CacheStorage interface {
	StorageType() string

	SetObject(Key string, v interface{}, seconds int32) (err error)
	GetObject(key string, v interface{}) (err error)

	GetMultiObject(keyValues map[string]interface{}) (err error)

	Set(key string, v string, seconds int32) (err error)
	Get(key string) (v string, err error)
	GetMulti(keys []string) (values map[string]string, err error)

	Touch(key string, seconds int32) (err error)

	Increment(key string, delta uint64) (newValue int64, err error)
	Decrement(key string, delta uint64) (newValue int64, err error)

	Delete(key string) error
	DeleteAll() error
}

type MemcachedStorage

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

func NewMemcachedStorage

func NewMemcachedStorage(endpoints ...string) (storage *MemcachedStorage, err error)

func (*MemcachedStorage) Decrement

func (p *MemcachedStorage) Decrement(key string, delta uint64) (newValue int64, err error)

func (*MemcachedStorage) Delete

func (p *MemcachedStorage) Delete(key string) (err error)

func (*MemcachedStorage) DeleteAll

func (p *MemcachedStorage) DeleteAll() (err error)

func (*MemcachedStorage) Get

func (p *MemcachedStorage) Get(key string) (v string, err error)

func (*MemcachedStorage) GetMulti

func (p *MemcachedStorage) GetMulti(keys []string) (values map[string]string, err error)

func (*MemcachedStorage) GetMultiObject

func (p *MemcachedStorage) GetMultiObject(keyValues map[string]interface{}) (err error)

func (*MemcachedStorage) GetObject

func (p *MemcachedStorage) GetObject(key string, v interface{}) (err error)

func (*MemcachedStorage) Increment

func (p *MemcachedStorage) Increment(key string, delta uint64) (newValue int64, err error)

func (*MemcachedStorage) Set

func (p *MemcachedStorage) Set(key string, v string, seconds int32) (err error)

func (*MemcachedStorage) SetObject

func (p *MemcachedStorage) SetObject(key string, v interface{}, seconds int32) (err error)

func (*MemcachedStorage) StorageType

func (p *MemcachedStorage) StorageType() string

func (*MemcachedStorage) Touch

func (p *MemcachedStorage) Touch(key string, seconds int32) (err error)

type RedisStorage

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

func NewAuthRedisStorage

func NewAuthRedisStorage(conn string, db int, auth string) (storage *RedisStorage, err error)

func NewRedisStorage

func NewRedisStorage(conn string, db int) (storage *RedisStorage, err error)

func (*RedisStorage) Decrement

func (p *RedisStorage) Decrement(key string, delta uint64) (newValue int64, err error)

func (*RedisStorage) Delete

func (p *RedisStorage) Delete(key string) (err error)

func (*RedisStorage) DeleteAll

func (p *RedisStorage) DeleteAll() (err error)

func (*RedisStorage) Get

func (p *RedisStorage) Get(key string) (value string, err error)

func (*RedisStorage) GetInt

func (p *RedisStorage) GetInt(key string) (value int64, err error)

func (*RedisStorage) GetMulti

func (p *RedisStorage) GetMulti(keys []string) (values map[string]string, err error)

func (*RedisStorage) GetMultiObject

func (p *RedisStorage) GetMultiObject(keyValues map[string]interface{}) (err error)

func (*RedisStorage) GetObject

func (p *RedisStorage) GetObject(key string, value interface{}) (err error)

get cache from redis.

func (*RedisStorage) GetSet

func (p *RedisStorage) GetSet(key, value string) (result string, err error)

func (*RedisStorage) Increment

func (p *RedisStorage) Increment(key string, delta uint64) (newValue int64, err error)

func (*RedisStorage) Set

func (p *RedisStorage) Set(key, value string, seconds int32) (err error)

func (*RedisStorage) SetInt

func (p *RedisStorage) SetInt(key string, value int64, seconds int32) (err error)

func (*RedisStorage) SetNX

func (p *RedisStorage) SetNX(key, value string) (result int, err error)

func (*RedisStorage) SetObject

func (p *RedisStorage) SetObject(key string, value interface{}, seconds int32) (err error)

put cache to redis

func (*RedisStorage) StorageType

func (p *RedisStorage) StorageType() string

func (*RedisStorage) Touch

func (p *RedisStorage) Touch(key string, seconds int32) (err error)

type StorageValue

type StorageValue struct {
	V interface{} `json:"v"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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