resp

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STRING  = '+'
	ERROR   = '-'
	INTEGER = ':'
	BULK    = '$'
	ARRAY   = '*'
	SET     = '~'
)
View Source
const (
	TYPE_ARRAY   = "array"
	TYPE_INTEGER = "integer"
	TYPE_BULK    = "bulk"
	TYPE_ERROR   = "error"
	TYPE_STRING  = "string"
	TYPE_NULL    = "null"
	TYPE_SET     = "set"
	TYPE_VOID    = "void"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RespReader

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

func NewRespReader

func NewRespReader(reader io.Reader) *RespReader

func (*RespReader) ReadResp

func (r *RespReader) ReadResp() (RespValue, error)

type RespValue

type RespValue struct {
	Type  string
	Str   string
	Num   int
	Bulk  string
	Array []RespValue
}

func NewRespValue

func NewRespValue() *RespValue

func (RespValue) Marshall

func (v RespValue) Marshall() []byte

type RespWriter

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

func NewRespWriter

func NewRespWriter(writer io.Writer) *RespWriter

func (*RespWriter) WriteErrorResp

func (w *RespWriter) WriteErrorResp(e error) error

func (*RespWriter) WriteResp

func (w *RespWriter) WriteResp(v RespValue) error

Jump to

Keyboard shortcuts

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