resproto2

package
v0.0.0-...-9f455dc Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRLF = "\r\n"

	CR = '\r'
	LF = '\n'
)

Variables

View Source
var (
	ErrInvalidReader      = errors.New("invalid reader")
	ErrInvalidHeader      = errors.New("invalid header")
	ErrMismatchHeaderType = errors.New("mismatch header type")
	// EOF represent an individual message parse completed
	EOF = errors.New("RESP EOF")
)

Functions

This section is empty.

Types

type ArrayMsg

type ArrayMsg struct {
	// contains filtered or unexported fields
}

func (ArrayMsg) Array

func (a ArrayMsg) Array() []Data

func (ArrayMsg) Bytes

func (a ArrayMsg) Bytes() []byte

func (ArrayMsg) Len

func (a ArrayMsg) Len() int64

type BulkStringMsg

type BulkStringMsg struct {
	// contains filtered or unexported fields
}

func (BulkStringMsg) Bytes

func (b BulkStringMsg) Bytes() []byte

func (BulkStringMsg) Len

func (b BulkStringMsg) Len() int64

type Data

type Data interface {
	Bytes() []byte
}

type ErrorMsg

type ErrorMsg struct {
	// contains filtered or unexported fields
}

func (ErrorMsg) Bytes

func (e ErrorMsg) Bytes() []byte

func (ErrorMsg) Error

func (e ErrorMsg) Error() error

type IntegerMsg

type IntegerMsg struct {
	// contains filtered or unexported fields
}

func (IntegerMsg) Bytes

func (i IntegerMsg) Bytes() []byte

func (IntegerMsg) Int64

func (i IntegerMsg) Int64() int64

type RespIterator

type RespIterator func() (Data, error)

func ParseRespProto

func ParseRespProto(reader io.Reader) RespIterator

ParseRespProto RESP Protocol parser

type RespProtocolParser

type RespProtocolParser func(firstLine []byte, reader textproto.Reader) (Data, error)

type StatusMsg

type StatusMsg struct {
	// contains filtered or unexported fields
}

func (StatusMsg) Bytes

func (s StatusMsg) Bytes() []byte

func (StatusMsg) Status

func (s StatusMsg) Status() string

Jump to

Keyboard shortcuts

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