redis

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2016 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadRespCRLFEnd  = errors.New("bad resp CRLF end")
	ErrBadRespBytesLen = errors.New("bad resp bytes len")
	ErrBadRespArrayLen = errors.New("bad resp array len")
)

Functions

func AsBulkBytes

func AsBulkBytes(r Resp, err error) ([]byte, error)

func AsError

func AsError(r Resp, err error) (string, error)

func AsInt

func AsInt(r Resp, err error) (int64, error)

func AsString

func AsString(r Resp, err error) (string, error)

func Encode

func Encode(w *bufio.Writer, r Resp, flush bool) error

func EncodeToBytes

func EncodeToBytes(r Resp) ([]byte, error)

func EncodeToString

func EncodeToString(r Resp) (string, error)

func MustEncode

func MustEncode(w *bufio.Writer, r Resp)

func MustEncodeToBytes

func MustEncodeToBytes(r Resp) []byte

func MustHandlerTable

func MustHandlerTable(o interface{}) map[string]HandlerFunc

func NewHandlerTable

func NewHandlerTable(o interface{}) (map[string]HandlerFunc, error)

func ParseArgs

func ParseArgs(resp Resp) (cmd string, args [][]byte, err error)

Types

type Array

type Array struct {
	Value []Resp
}

func NewArray

func NewArray() *Array

func (*Array) Append

func (r *Array) Append(a Resp)

func (*Array) AppendBulkBytes

func (r *Array) AppendBulkBytes(b []byte)

func (*Array) AppendError

func (r *Array) AppendError(err error)

func (*Array) AppendInt

func (r *Array) AppendInt(n int64)

func (*Array) AppendString

func (r *Array) AppendString(s string)

type BulkBytes

type BulkBytes struct {
	Value []byte
}

func NewBulkBytes

func NewBulkBytes(p []byte) *BulkBytes

type Error

type Error struct {
	Value string
}

func NewError

func NewError(err error) *Error

type HandlerFunc

type HandlerFunc func(arg0 interface{}, args ...[]byte) (Resp, error)

type HandlerTable

type HandlerTable map[string]HandlerFunc

type Int

type Int struct {
	Value int64
}

func NewInt

func NewInt(n int64) *Int

type Resp

type Resp interface {
}

func AsArray

func AsArray(r Resp, err error) ([]Resp, error)

func Decode

func Decode(r *bufio.Reader) (Resp, error)

func DecodeFromBytes

func DecodeFromBytes(p []byte) (Resp, error)

func MustDecode

func MustDecode(r *bufio.Reader) Resp

func MustDecodeFromBytes

func MustDecodeFromBytes(p []byte) Resp

func NewCommand

func NewCommand(cmd string, args ...interface{}) Resp

type Server

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

func MustServer

func MustServer(o interface{}) *Server

func NewServer

func NewServer(o interface{}) (*Server, error)

func NewServerWithTable

func NewServerWithTable(t HandlerTable) (*Server, error)

func (*Server) Dispatch

func (s *Server) Dispatch(arg0 interface{}, resp Resp) (Resp, error)

type String

type String struct {
	Value string
}

func NewString

func NewString(s string) *String

Jump to

Keyboard shortcuts

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