parser

package
v0.0.0-...-b131dfc Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorResp = iota
	SimpleString
	IntegerResp
	BulkResp
	MultiResp
	NoKey
)

Variables

View Source
var (
	NEW_LINE   = []byte("\r\n")
	EMPTY_LINE []byte
)

* redis protocal : Resp protocol * http://redis.io/topics/protocol

Functions

func Btoi

func Btoi(b []byte) (int, error)

todo: overflow

func IsLetter

func IsLetter(c byte) bool

func Itoa

func Itoa(i int) []byte

func ReadBulk

func ReadBulk(r *bufio.Reader, size int, raw *[]byte) error

Types

type Resp

type Resp struct {
	Type  int
	Raw   []byte
	Multi []*Resp
}

func Parse

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

func (*Resp) Bytes

func (r *Resp) Bytes() ([]byte, error)

func (*Resp) GetOpKeys

func (r *Resp) GetOpKeys() (op []byte, keys [][]byte, err error)

Jump to

Keyboard shortcuts

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