Categorygithub.com/artyom/resp
modulepackage
1.0.0
Repository: https://github.com/artyom/resp.git
Documentation: pkg.go.dev

# README

This is a fork of github.com/PuerkitoBio/gred/resp as of cf07a88c0746e196780b10816ea4d7294434b4c1

# Functions

Decode decodes the provided byte slice and returns the parsed value.
DecodeRequest decodes the provided byte slice and returns the array representing the request.
Encode encode the value v and writes the serialized data to w.

# Variables

ErrInvalidArray is returned if the array data cannot be decoded.
ErrInvalidBulkString is returned if the bulk string data cannot be decoded.
ErrInvalidInteger is returned if an invalid character is found while parsing an integer.
ErrInvalidPrefix is returned if the data contains an unrecognized prefix.
ErrInvalidRequest is returned if the DecodeRequest function is called and the decoded value is not an array containing only bulk strings, and at least 1 element.
ErrInvalidValue is returned if the value to encode is invalid.
ErrMissingCRLF is returned if a \r\n is missing in the data slice.
ErrNotAnArray is returned if the DecodeRequest function is called and the decoded value is not an array.
OK is a sentinel value used to indicate that the OK simple string value should be encoded.
Pong is a sentinel value used to indicate that the PONG simple string value should be encoded.

# Interfaces

BytesReader defines the methods required for the Decode* family of methods.

# Type aliases

Array represents an array of values, as defined by the RESP.
BulkString represents a binary-safe string as defined by the RESP.
Error represents an error string as defined by the RESP.
SimpleString represents a simple string as defined by the RESP.