memcache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxCommandInfoBytes = 512

	RspErr       = []byte("ERROR\r\n")
	RspStored    = []byte("STORED\r\n")
	RspNotStored = []byte("NOT_STORED\r\n")
	RspExists    = []byte("EXISTS\r\n")
	RspNotFound  = []byte("NOT_FOUND\r\n")
	RspDeleted   = []byte("DELETED\r\n")
	RspEnd       = []byte("END\r\n")
	RspTouched   = []byte("TOUCHED\r\n")

	EOL = []byte("\r\n")
)
View Source
var (
	ErrNeedMoreData = errors.New("need more data")
)

Functions

func MakeRspClientErr

func MakeRspClientErr(err error) []byte

func MakeRspServerErr

func MakeRspServerErr(err error) []byte

Types

type CommandInfo

type CommandInfo struct {
	Cmd        string
	Key        string
	Keys       []string // for retrieval commands
	Delta      uint64   // for incr/decr
	Flags      uint32
	Exptime    uint32
	PayloadLen int64
	CasUnique  int64
	NoReply    bool
}

func ParseCommand

func ParseCommand(data []byte) (advance int, cmdinfo *CommandInfo, err error)

ParseCommand parses cmd from `data` and return CommandInfo return ErrNeedMoreData if data not contains '\n' implements: https://github.com/memcached/memcached/blob/master/doc/protocol.txt

Jump to

Keyboard shortcuts

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