redisgo

package
v0.0.0-...-a390a54 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 0

README

redisgo

yet another redis protocol codec

COPY FROM https://github.com/rokumoe/redisgo

  • fix decode issue

Documentation

Index

Constants

View Source
const (
	SimpleKind  RespKind = '+'
	ErrorKind            = '-'
	IntegerKind          = ':'
	BlukKind             = '$'
	ArrayKind            = '*'
)

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, v Value) (err error)

func EncodeMulti

func EncodeMulti(w io.Writer, vals ...Value) error

func EncodeResp

func EncodeResp(w io.Writer, r *Resp) (err error)

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader, maxLineSize int) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(r *Resp) error

type Resp

type Resp struct {
	Kind  RespKind
	Null  bool
	Data  string
	Array []Resp
}

func (*Resp) String

func (r *Resp) String() string

type RespKind

type RespKind byte

type Value

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

func Bluk

func Bluk(p []byte) Value

func BlukString

func BlukString(s string) Value

func Error

func Error(err string) Value

func Int

func Int(v int) Value

func Int16

func Int16(v int16) Value

func Int32

func Int32(v int32) Value

func Int64

func Int64(v int64) Value

func Int8

func Int8(v int8) Value

func Null

func Null() Value

func Simple

func Simple(s string) Value

func Uint

func Uint(v uint) Value

func Uint16

func Uint16(v uint16) Value

func Uint32

func Uint32(v uint32) Value

func Uint64

func Uint64(v uint64) Value

func Uint8

func Uint8(v uint8) Value

Jump to

Keyboard shortcuts

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