Documentation ¶
Index ¶
- Variables
- func Debugf(format string, a ...interface{})
- func ReplyToString(r ReplyWriter) (string, error)
- type BulkReply
- type ChannelWriter
- type CheckerFn
- type Config
- type Database
- type DefaultHandler
- func (h *DefaultHandler) Blpop(key string, keys ...string) (data [][]byte, err error)
- func (h *DefaultHandler) Brpop(key string, keys ...string) (data [][]byte, err error)
- func (h *DefaultHandler) Del(key string, keys ...string) (int, error)
- func (h *DefaultHandler) Get(key string) ([]byte, error)
- func (h *DefaultHandler) Hget(key, subkey string) ([]byte, error)
- func (h *DefaultHandler) Hgetall(key string) (HashValue, error)
- func (h *DefaultHandler) Hset(key, subkey string, value []byte) (int, error)
- func (h *DefaultHandler) Lindex(key string, index int) ([]byte, error)
- func (h *DefaultHandler) Lpush(key string, value []byte, values ...[]byte) (int, error)
- func (h *DefaultHandler) Lrange(key string, start, stop int) ([][]byte, error)
- func (h *DefaultHandler) Monitor() (*MonitorReply, error)
- func (h *DefaultHandler) Ping() (*StatusReply, error)
- func (h *DefaultHandler) Publish(key string, value []byte) (int, error)
- func (h *DefaultHandler) Rpush(key string, value []byte, values ...[]byte) (int, error)
- func (h *DefaultHandler) Select(key string) error
- func (h *DefaultHandler) Set(key string, value []byte) error
- func (h *DefaultHandler) Subscribe(channels ...[]byte) (*MultiChannelWriter, error)
- type ErrorReply
- type HandlerFn
- type HashBrStack
- type HashHash
- type HashSub
- type HashValue
- type IntegerReply
- type MonitorReply
- type MultiBulkReply
- type MultiChannelWriter
- type ReplyWriter
- type Request
- func (r *Request) ExpectArgument(index int) ReplyWriter
- func (r *Request) GetInteger(index int) (int, ReplyWriter)
- func (r *Request) GetMap(index int) (map[string][]byte, ReplyWriter)
- func (r *Request) GetPositiveInteger(index int) (int, ReplyWriter)
- func (r *Request) GetString(index int) (string, ReplyWriter)
- func (r *Request) GetStringSlice(index int) ([]string, ReplyWriter)
- func (r *Request) HasArgument(index int) bool
- type Server
- func (srv *Server) Apply(r *Request) (ReplyWriter, error)
- func (srv *Server) ApplyString(r *Request) (string, error)
- func (srv *Server) ListenAndServe(maxConnection int) error
- func (srv *Server) Register(name string, fn HandlerFn)
- func (srv *Server) RegisterFct(key string, f interface{}) error
- func (srv *Server) Serve(l net.Listener) error
- func (srv *Server) ServeClient(conn net.Conn) (err error)
- type Stack
- type StatusReply
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMethodNotSupported = NewError("Method is not supported") ErrNotEnoughArgs = NewError("Not enough arguments for the command") ErrTooMuchArgs = NewError("Too many arguments for the command") ErrWrongArgsNumber = NewError("Wrong number of arguments") ErrExpectInteger = NewError("Expected integer") ErrExpectPositivInteger = NewError("Expected positive integer") ErrExpectMorePair = NewError("Expected at least one key val pair") ErrExpectEvenPair = NewError("Got uneven number of key val pairs") )
View Source
var (
ErrParseTimeout = errors.New("timeout is not an integer or out of range")
)
Functions ¶
func Debugf ¶
func Debugf(format string, a ...interface{})
Debug function, if the debug flag is set, then display. Do nothing otherwise If Docker is in damon mode, also send the debug info on the socket Convenience debug function, courtesy of http://github.com/dotcloud/docker
func ReplyToString ¶
func ReplyToString(r ReplyWriter) (string, error)
Types ¶
type ChannelWriter ¶
type ChannelWriter struct { FirstReply []interface{} Channel chan []interface{} // contains filtered or unexported fields }
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
type DefaultHandler ¶
type DefaultHandler struct { *Database // contains filtered or unexported fields }
func NewDefaultHandler ¶
func NewDefaultHandler() *DefaultHandler
func (*DefaultHandler) Blpop ¶
func (h *DefaultHandler) Blpop(key string, keys ...string) (data [][]byte, err error)
func (*DefaultHandler) Brpop ¶
func (h *DefaultHandler) Brpop(key string, keys ...string) (data [][]byte, err error)
func (*DefaultHandler) Hset ¶
func (h *DefaultHandler) Hset(key, subkey string, value []byte) (int, error)
func (*DefaultHandler) Lindex ¶
func (h *DefaultHandler) Lindex(key string, index int) ([]byte, error)
func (*DefaultHandler) Lrange ¶
func (h *DefaultHandler) Lrange(key string, start, stop int) ([][]byte, error)
func (*DefaultHandler) Monitor ¶
func (h *DefaultHandler) Monitor() (*MonitorReply, error)
func (*DefaultHandler) Ping ¶
func (h *DefaultHandler) Ping() (*StatusReply, error)
func (*DefaultHandler) Publish ¶
func (h *DefaultHandler) Publish(key string, value []byte) (int, error)
func (*DefaultHandler) Select ¶
func (h *DefaultHandler) Select(key string) error
func (*DefaultHandler) Subscribe ¶
func (h *DefaultHandler) Subscribe(channels ...[]byte) (*MultiChannelWriter, error)
type ErrorReply ¶
type ErrorReply struct {
// contains filtered or unexported fields
}
func NewError ¶
func NewError(message string) *ErrorReply
func (*ErrorReply) Error ¶
func (er *ErrorReply) Error() string
type HandlerFn ¶
type HandlerFn func(r *Request) (ReplyWriter, error)
type HashBrStack ¶
type HashSub ¶
type HashSub map[string][]*ChannelWriter
type IntegerReply ¶
type IntegerReply struct {
// contains filtered or unexported fields
}
type MonitorReply ¶
type MonitorReply struct {
// contains filtered or unexported fields
}
type MultiBulkReply ¶
type MultiBulkReply struct {
// contains filtered or unexported fields
}
for nil reply in multi bulk just set []byte as nil
func MultiBulkFromMap ¶
func MultiBulkFromMap(m map[string]interface{}) *MultiBulkReply
type MultiChannelWriter ¶
type MultiChannelWriter struct {
Chans []*ChannelWriter
}
type ReplyWriter ¶
type Request ¶
func (*Request) ExpectArgument ¶
func (r *Request) ExpectArgument(index int) ReplyWriter
func (*Request) GetInteger ¶
func (r *Request) GetInteger(index int) (int, ReplyWriter)
func (*Request) GetPositiveInteger ¶
func (r *Request) GetPositiveInteger(index int) (int, ReplyWriter)
func (*Request) GetStringSlice ¶
func (r *Request) GetStringSlice(index int) ([]string, ReplyWriter)
func (*Request) HasArgument ¶
type Server ¶
type Server struct { Proto string Addr string // TCP address to listen on, ":6389" if empty MonitorChans []chan string // contains filtered or unexported fields }
func (*Server) ListenAndServe ¶
ListenAndServe receives an argument maxConnection, which limit max connection it can accept simultaneous, passing maxConnection <= 0 means no limit.
func (*Server) RegisterFct ¶
type Stack ¶
type Stack struct { sync.Mutex Key string Chan chan *Stack // contains filtered or unexported fields }
type StatusReply ¶
type StatusReply struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.