Documentation ¶
Overview ¶
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrConnUnusable ¶
ErrConnUnusable takes an existing error and, if it is wrapped in an ErrConnUsable, unwraps the ErrConnUsable from around it.
Types ¶
type ErrConnUsable ¶
type ErrConnUsable struct {
Err error
}
ErrConnUsable is used to wrap an error encountered while marshaling or unmarshaling a message on a connection. It indicates that the network connection is still healthy and that there are no partially written/read messages on the stream.
func (ErrConnUsable) Error ¶
func (ed ErrConnUsable) Error() string
func (ErrConnUsable) Unwrap ¶
func (ed ErrConnUsable) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type LenReader ¶
LenReader adds an additional method to io.Reader, returning how many bytes are left till be read until an io.EOF is reached.
type Marshaler ¶
Marshaler is the interface implemented by types that can marshal themselves into valid RESP.
NOTE It's important to keep track of whether a partial RESP message has been written to the Writer, and to use ErrConnUnusable when returning errors if a partial RESP message has not been written.
type Unmarshaler ¶
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. Use ErrConnUsable when applicable.
Directories ¶
Path | Synopsis |
---|---|
Package resp2 implements the original redis RESP protocol, a plaintext protocol which is also binary safe.
|
Package resp2 implements the original redis RESP protocol, a plaintext protocol which is also binary safe. |
Package resp3 implements the upgraded redis RESP3 protocol, a plaintext protocol which is also binary safe and backwards compatible with the original RESP2 protocol.
|
Package resp3 implements the upgraded redis RESP3 protocol, a plaintext protocol which is also binary safe and backwards compatible with the original RESP2 protocol. |