radix: github.com/mediocregopher/radix/resp Index | Files | Directories

package resp

import "github.com/mediocregopher/radix/resp"

Package resp is an umbrella package which covers both the old RESP protocol (resp2) and the new one (resp3), allowing clients to choose which one they care to use

Index

Package Files

resp.go util.go

type ErrDiscarded Uses

type ErrDiscarded struct {
    Err error
}

ErrDiscarded is used to wrap an error encountered while unmarshaling a message. If an error was encountered during unmarshaling but the rest of the message was successfully discarded off of the wire, then the error can be wrapped in this type.

func (ErrDiscarded) Error Uses

func (ed ErrDiscarded) Error() string

func (ErrDiscarded) Unwrap Uses

func (ed ErrDiscarded) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type LenReader Uses

type LenReader interface {
    io.Reader
    Len() int64
}

LenReader adds an additional method to io.Reader, returning how many bytes are left till be read until an io.EOF is reached.

func NewLenReader Uses

func NewLenReader(r io.Reader, l int64) LenReader

NewLenReader wraps an existing io.Reader whose length is known so that it implements LenReader

type Marshaler Uses

type Marshaler interface {
    MarshalRESP(io.Writer) error
}

Marshaler is the interface implemented by types that can marshal themselves into valid RESP.

type Unmarshaler Uses

type Unmarshaler interface {
    UnmarshalRESP(*bufio.Reader) error
}

Unmarshaler is the interface implemented by types that can unmarshal a RESP description of themselves. UnmarshalRESP should _always_ fully consume a RESP message off the reader, unless there is an error returned from the reader itself.

Note that, unlike Marshaler, Unmarshaler _must_ take in a *bufio.Reader.

Directories

PathSynopsis
resp2Package resp2 implements the original redis RESP protocol, a plaintext protocol which is also binary safe.

Package resp imports 2 packages (graph) and is imported by 1 packages. Updated 2019-07-25. Refresh now. Tools for package owners.