service

package
v0.0.0-...-70285c8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2016 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCmd

func AppendCmd(s Session, args [][]byte) (redis.Resp, error)

APPEND key value

func AuthCmd

func AuthCmd(s Session, args [][]byte) (redis.Resp, error)

AUTH password

func BgsaveCmd

func BgsaveCmd(s Session, args [][]byte) (redis.Resp, error)

BGSAVE

func BgsaveToCmd

func BgsaveToCmd(s Session, args [][]byte) (redis.Resp, error)

BGSAVETO path

func CompactAllCmd

func CompactAllCmd(s Session, args [][]byte) (redis.Resp, error)

COMPACTALL

func ConfigCmd

func ConfigCmd(s Session, args [][]byte) (redis.Resp, error)

CONFIG get key / set key value

func DecrByCmd

func DecrByCmd(s Session, args [][]byte) (redis.Resp, error)

DECRBY key delta

func DecrCmd

func DecrCmd(s Session, args [][]byte) (redis.Resp, error)

DECR key

func DelCmd

func DelCmd(s Session, args [][]byte) (redis.Resp, error)

DEL key [key ...]

func DumpCmd

func DumpCmd(s Session, args [][]byte) (redis.Resp, error)

DUMP key

func EchoCmd

func EchoCmd(s Session, args [][]byte) (redis.Resp, error)

ECHO text

func ExistsCmd

func ExistsCmd(s Session, args [][]byte) (redis.Resp, error)

EXISTS key

func ExpireAtCmd

func ExpireAtCmd(s Session, args [][]byte) (redis.Resp, error)

EXPIREAT key timestamp

func ExpireCmd

func ExpireCmd(s Session, args [][]byte) (redis.Resp, error)

EXPIRE key seconds

func FlushAllCmd

func FlushAllCmd(s Session, args [][]byte) (redis.Resp, error)

FLUSHALL

func GetCmd

func GetCmd(s Session, args [][]byte) (redis.Resp, error)

GET key

func GetSetCmd

func GetSetCmd(s Session, args [][]byte) (redis.Resp, error)

GETSET key value

func HDelCmd

func HDelCmd(s Session, args [][]byte) (redis.Resp, error)

HDEL key field [field ...]

func HExistsCmd

func HExistsCmd(s Session, args [][]byte) (redis.Resp, error)

HEXISTS key field

func HGetAllCmd

func HGetAllCmd(s Session, args [][]byte) (redis.Resp, error)

HGETALL key

func HGetCmd

func HGetCmd(s Session, args [][]byte) (redis.Resp, error)

HGET key field

func HIncrByCmd

func HIncrByCmd(s Session, args [][]byte) (redis.Resp, error)

HINCRBY key field delta

func HIncrByFloatCmd

func HIncrByFloatCmd(s Session, args [][]byte) (redis.Resp, error)

HINCRBYFLOAT key field delta

func HKeysCmd

func HKeysCmd(s Session, args [][]byte) (redis.Resp, error)

HKEYS key

func HLenCmd

func HLenCmd(s Session, args [][]byte) (redis.Resp, error)

HLEN key

func HMGetCmd

func HMGetCmd(s Session, args [][]byte) (redis.Resp, error)

HMGET key field [field ...]

func HMSetCmd

func HMSetCmd(s Session, args [][]byte) (redis.Resp, error)

HMSET key field value [field value ...]

func HSetCmd

func HSetCmd(s Session, args [][]byte) (redis.Resp, error)

HSET key field value

func HSetNXCmd

func HSetNXCmd(s Session, args [][]byte) (redis.Resp, error)

HSETNX key field value

func HValsCmd

func HValsCmd(s Session, args [][]byte) (redis.Resp, error)

HVALS key

func IncrByCmd

func IncrByCmd(s Session, args [][]byte) (redis.Resp, error)

INCRBY key delta

func IncrByFloatCmd

func IncrByFloatCmd(s Session, args [][]byte) (redis.Resp, error)

INCRBYFLOAT key delta

func IncrCmd

func IncrCmd(s Session, args [][]byte) (redis.Resp, error)

INCR key

func InfoCmd

func InfoCmd(s Session, args [][]byte) (redis.Resp, error)

INFO [section]

func LIndexCmd

func LIndexCmd(s Session, args [][]byte) (redis.Resp, error)

LINDEX key index

func LLenCmd

func LLenCmd(s Session, args [][]byte) (redis.Resp, error)

LLEN key

func LPopCmd

func LPopCmd(s Session, args [][]byte) (redis.Resp, error)

LPOP key

func LPushCmd

func LPushCmd(s Session, args [][]byte) (redis.Resp, error)

LPUSH key value [value ...]

func LPushXCmd

func LPushXCmd(s Session, args [][]byte) (redis.Resp, error)

LPUSHX key value [value ...]

func LRangeCmd

func LRangeCmd(s Session, args [][]byte) (redis.Resp, error)

LRANGE key beg end

func LSetCmd

func LSetCmd(s Session, args [][]byte) (redis.Resp, error)

LSET key index value

func LTrimCmd

func LTrimCmd(s Session, args [][]byte) (redis.Resp, error)

LTRIM key beg end

func MGetCmd

func MGetCmd(s Session, args [][]byte) (redis.Resp, error)

MGET key [key ...]

func MSetCmd

func MSetCmd(s Session, args [][]byte) (redis.Resp, error)

MSET key value [key value ...]

func MSetNXCmd

func MSetNXCmd(s Session, args [][]byte) (redis.Resp, error)

MSETNX key value [key value ...]

func PExpireAtCmd

func PExpireAtCmd(s Session, args [][]byte) (redis.Resp, error)

PEXPIREAT key timestamp

func PExpireCmd

func PExpireCmd(s Session, args [][]byte) (redis.Resp, error)

PEXPIRE key milliseconds

func PSetEXCmd

func PSetEXCmd(s Session, args [][]byte) (redis.Resp, error)

PSETEX key milliseconds value

func PSyncCmd

func PSyncCmd(s Session, args [][]byte) (redis.Resp, error)

PSYNC run-id sync-offset

func PTTLCmd

func PTTLCmd(s Session, args [][]byte) (redis.Resp, error)

PTTL key

func PersistCmd

func PersistCmd(s Session, args [][]byte) (redis.Resp, error)

PERSIST key

func PingCmd

func PingCmd(s Session, args [][]byte) (redis.Resp, error)

PING

func RPopCmd

func RPopCmd(s Session, args [][]byte) (redis.Resp, error)

RPOP key

func RPushCmd

func RPushCmd(s Session, args [][]byte) (redis.Resp, error)

RPUSH key value [value ...]

func RPushXCmd

func RPushXCmd(s Session, args [][]byte) (redis.Resp, error)

LPUSHX key value [value ...]

func Register

func Register(name string, f CommandFunc)

func RegisterArrayReply

func RegisterArrayReply(name string, f CommandArrayFunc)

func RegisterBulkReply

func RegisterBulkReply(name string, f CommandBulkStringFunc)

func RegisterIntReply

func RegisterIntReply(name string, f CommandIntFunc)

func RegisterOKReply

func RegisterOKReply(name string, f CommandOKFunc)

func RegisterStringReply

func RegisterStringReply(name string, f CommandSimpleStringFunc)

func ReplConfCmd

func ReplConfCmd(s Session, args [][]byte) (redis.Resp, error)

REPLCONF listening-port port / ack sync-offset

func RestoreCmd

func RestoreCmd(s Session, args [][]byte) (redis.Resp, error)

RESTORE key ttlms value

func RoleCmd

func RoleCmd(s Session, args [][]byte) (redis.Resp, error)

ROLE

func SAddCmd

func SAddCmd(s Session, args [][]byte) (redis.Resp, error)

SADD key member [member ...]

func SCardCmd

func SCardCmd(s Session, args [][]byte) (redis.Resp, error)

SCARD key

func SIsMemberCmd

func SIsMemberCmd(s Session, args [][]byte) (redis.Resp, error)

SISMEMBER key member

func SMembersCmd

func SMembersCmd(s Session, args [][]byte) (redis.Resp, error)

SMEMBERS key

func SPopCmd

func SPopCmd(s Session, args [][]byte) (redis.Resp, error)

SPOP key

func SRandMemberCmd

func SRandMemberCmd(s Session, args [][]byte) (redis.Resp, error)

SRANDMEMBER key [count]

func SRemCmd

func SRemCmd(s Session, args [][]byte) (redis.Resp, error)

SREM key member [member ...]

func SelectCmd

func SelectCmd(s Session, args [][]byte) (redis.Resp, error)

SELECT db

func SetBitCmd

func SetBitCmd(s Session, args [][]byte) (redis.Resp, error)

SETBIT key offset value

func SetCmd

func SetCmd(s Session, args [][]byte) (redis.Resp, error)

SET key value

func SetEXCmd

func SetEXCmd(s Session, args [][]byte) (redis.Resp, error)

SETEX key seconds value

func SetNXCmd

func SetNXCmd(s Session, args [][]byte) (redis.Resp, error)

SETNX key value

func SetRangeCmd

func SetRangeCmd(s Session, args [][]byte) (redis.Resp, error)

SETRANGE key offset value

func ShutdownCmd

func ShutdownCmd(s Session, args [][]byte) (redis.Resp, error)

SHUTDOWN

func SlaveOfCmd

func SlaveOfCmd(s Session, args [][]byte) (redis.Resp, error)

SLAVEOF host port

func SlotsHashKeyCmd

func SlotsHashKeyCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSHASHKEY key [key...]

func SlotsInfoCmd

func SlotsInfoCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSINFO [start [count]]

func SlotsMgrtOneCmd

func SlotsMgrtOneCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSMGRTONE host port timeout key

func SlotsMgrtSlotCmd

func SlotsMgrtSlotCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSMGRTSLOT host port timeout slot

func SlotsMgrtTagOneCmd

func SlotsMgrtTagOneCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSMGRTTAGONE host port timeout key

func SlotsMgrtTagSlotCmd

func SlotsMgrtTagSlotCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSMGRTTAGSLOT host port timeout slot

func SlotsRestoreCmd

func SlotsRestoreCmd(s Session, args [][]byte) (redis.Resp, error)

SLOTSRESTORE key ttlms value [key ttlms value ...]

func SyncCmd

func SyncCmd(s Session, args [][]byte) (redis.Resp, error)

SYNC

func TTLCmd

func TTLCmd(s Session, args [][]byte) (redis.Resp, error)

TTL key

func TypeCmd

func TypeCmd(s Session, args [][]byte) (redis.Resp, error)

TYPE key

func ZAddCmd

func ZAddCmd(s Session, args [][]byte) (redis.Resp, error)

ZADD key score member [score member ...]

func ZCardCmd

func ZCardCmd(s Session, args [][]byte) (redis.Resp, error)

ZCARD key

func ZCountCmd

func ZCountCmd(s Session, args [][]byte) (redis.Resp, error)

ZCOUNT key min max

func ZGetAllCmd

func ZGetAllCmd(s Session, args [][]byte) (redis.Resp, error)

ZGETALL key

func ZIncrByCmd

func ZIncrByCmd(s Session, args [][]byte) (redis.Resp, error)

ZINCRBY key delta member

func ZLexCountCmd

func ZLexCountCmd(s Session, args [][]byte) (redis.Resp, error)

ZLEXCOUNT key min max

func ZRangeByLexCmd

func ZRangeByLexCmd(s Session, args [][]byte) (redis.Resp, error)

ZRANGEBYLEX key start stop [LIMIT offset count]

func ZRangeByScoreCmd

func ZRangeByScoreCmd(s Session, args [][]byte) (redis.Resp, error)

ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]

func ZRangeCmd

func ZRangeCmd(s Session, args [][]byte) (redis.Resp, error)

ZRANGE key start stop [WITHSCORES]

func ZRankCmd

func ZRankCmd(s Session, args [][]byte) (redis.Resp, error)

ZRANK key member

func ZRemCmd

func ZRemCmd(s Session, args [][]byte) (redis.Resp, error)

ZREM key member [member ...]

func ZRemRangeByLexCmd

func ZRemRangeByLexCmd(s Session, args [][]byte) (redis.Resp, error)

ZREMRANGEBYLEX key min max

func ZRemRangeByRankCmd

func ZRemRangeByRankCmd(s Session, args [][]byte) (redis.Resp, error)

ZREMRANGEBYRANK key start stop

func ZRemRangeByScoreCmd

func ZRemRangeByScoreCmd(s Session, args [][]byte) (redis.Resp, error)

ZREMRANGEBYSCORE key min max

func ZRevRangeByLexCmd

func ZRevRangeByLexCmd(s Session, args [][]byte) (redis.Resp, error)

ZREVRANGEBYLEX key start stop [LIMIT offset count]

func ZRevRangeByScoreCmd

func ZRevRangeByScoreCmd(s Session, args [][]byte) (redis.Resp, error)

ZREVRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]

func ZRevRangeCmd

func ZRevRangeCmd(s Session, args [][]byte) (redis.Resp, error)

ZREVRANGE key start stop [WITHSCORES]

func ZRevRankCmd

func ZRevRankCmd(s Session, args [][]byte) (redis.Resp, error)

ZREVRANK key member

func ZScoreCmd

func ZScoreCmd(s Session, args [][]byte) (redis.Resp, error)

ZSCORE key member

Types

type CommandArrayFunc

type CommandArrayFunc func(s Session, args [][]byte) ([][]byte, error)

return array RESP, or error RESP if err is not nil

type CommandBulkStringFunc

type CommandBulkStringFunc func(s Session, args [][]byte) ([]byte, error)

return bulk string RESP, or error RESP if err is not nil

type CommandFunc

type CommandFunc func(s Session, args [][]byte) (redis.Resp, error)

return a common RESP

type CommandIntFunc

type CommandIntFunc func(s Session, args [][]byte) (int64, error)

return int64 RESP, or error RESP if err is not nil

type CommandOKFunc

type CommandOKFunc func(s Session, args [][]byte) error

return OK simple string RESP if error is nil, or error RESP if err is not nil

type CommandSimpleStringFunc

type CommandSimpleStringFunc func(s Session, args [][]byte) (string, error)

return simple string RESP, or error RESP if err is not nil

type Config

type Config struct {
	Listen      string `toml:"listen_address"`
	PidFile     string `toml:"pid_file"`
	DumpPath    string `toml:"dump_filepath"`
	ConnTimeout int    `toml:"conn_timeout"`

	SyncFilePath string `toml:"sync_file_path"`
	SyncFileSize int    `toml:"sync_file_size"`
	SyncBuffSize int    `toml:"sync_memory_buffer"`

	ReplPingSlavePeriod int `toml:"repl_ping_slave_period"`
	// If empty, we will use memory for replication backlog
	ReplBacklogFilePath string `toml:"repl_backlog_file_path"`
	ReplBacklogSize     int    `toml:"repl_backlog_size"`
	// If no slaves after time, backlog will be released.
	// 0 means to no release at all.
	ReplBacklogTTL int `toml:"repl_backlog_ttl"`

	Auth       string `toml:"auth"`
	MasterAuth string `toml:"master_auth"`
}

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) String

func (c *Config) String() string

type Handler

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

type Server

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

func NewServer

func NewServer(c *Config, s *store.Store) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Serve

func (s *Server) Serve() error

type Session

type Session interface {
	DB() uint32
	SetDB(db uint32)
	Store() *store.Store
}

Jump to

Keyboard shortcuts

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