redis

package
v0.0.0-...-fad388b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = appgo.NewApiErr(appgo.ECodeNotFound, "redis: value not found")
)

Functions

func Do

func Do(cmd string, args ...interface{}) (reply interface{}, err error)

Types

type DataStore

type DataStore interface {
	Read(key interface{}) (interface{}, error)
	Write(key, val interface{}) error
}

type Objects

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

func NewObjects

func NewObjects(namespace string, expire int, ds DataStore, sl Serializer) *Objects

func (*Objects) Get

func (o *Objects) Get(key, val interface{}) error

func (*Objects) GetWithStore

func (o *Objects) GetWithStore(key, val interface{}) error

func (*Objects) Set

func (o *Objects) Set(key, val interface{}) error

func (*Objects) SetWithStore

func (o *Objects) SetWithStore(key interface{}) error

type Serializer

type Serializer interface {
	ToBytes(val interface{}) ([]byte, error)
	FromBytes(data []byte, val interface{}) error
}

type Strings

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

func NewStrings

func NewStrings(namespace string, expire int) *Strings

func (*Strings) Get

func (s *Strings) Get(key interface{}) (string, error)

func (*Strings) Has

func (s *Strings) Has(key interface{}) (bool, error)

func (*Strings) Set

func (s *Strings) Set(key interface{}, val string) error

func (*Strings) SetEx

func (s *Strings) SetEx(key interface{}, expire int, val string) error

overwrite default expire

type Trans

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

func BeginTrans

func BeginTrans() *Trans

func (*Trans) Exec

func (t *Trans) Exec() (reply interface{}, err error)

func (*Trans) Send

func (t *Trans) Send(cmd string, args ...interface{})

type ZsetIncrbyParams

type ZsetIncrbyParams struct {
	Key   interface{}
	Item  interface{}
	Score float64
}

type Zsets

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

func NewZsets

func NewZsets(namespace string) *Zsets

func (*Zsets) Add

func (z *Zsets) Add(key interface{}, score float64, item interface{}) error

func (*Zsets) BatchIncrby

func (z *Zsets) BatchIncrby(params []ZsetIncrbyParams) error

func (*Zsets) Card

func (z *Zsets) Card(key interface{}) (int, error)

func (*Zsets) Clear

func (z *Zsets) Clear(key interface{}) error

func (*Zsets) Count

func (z *Zsets) Count(key, min, max interface{}) (int, error)

func (*Zsets) Incrby

func (z *Zsets) Incrby(key interface{}, score float64, item interface{}) error

func (*Zsets) Max

func (z *Zsets) Max(key interface{}) (interface{}, error)

func (*Zsets) MaxStr

func (z *Zsets) MaxStr(key interface{}) (string, error)

func (*Zsets) Min

func (z *Zsets) Min(key interface{}) (interface{}, error)

func (*Zsets) MinStr

func (z *Zsets) MinStr(key interface{}) (string, error)

func (*Zsets) Range

func (z *Zsets) Range(key interface{}, b, e int, rev, withscores bool) ([]interface{}, error)

func (*Zsets) RangeByScore

func (z *Zsets) RangeByScore(
	key interface{}, max float64, maxInclusive bool, min float64, minInclusive bool,
	offset, limit int, rev, withscores bool) ([]interface{}, error)

func (*Zsets) RangeByScoreStr

func (z *Zsets) RangeByScoreStr(
	key interface{}, max float64, maxInclusive bool, min float64, minInclusive bool,
	offset, limit int, rev, withscores bool) ([]string, error)

func (*Zsets) RangeStr

func (z *Zsets) RangeStr(key interface{}, b, e int, rev, withscores bool) ([]string, error)

func (*Zsets) Rem

func (z *Zsets) Rem(key, item interface{}) error

func (*Zsets) RemByScore

func (z *Zsets) RemByScore(key interface{}, min, max float64) error

Jump to

Keyboard shortcuts

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