resp

package
v0.0.0-...-5e22790 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MsgOpUnchecked = MessageOp(iota)
	MsgOpAuth
	MsgOpSelect
	MsgOpBroken
	MsgOpOther
)

Variables

View Source
var (
	MsgOk            = []byte("+OK\r\n")
	MsgNoAuth        = []byte("-NOAUTH Authentication required.\r\n")
	MsgInvalidPass   = []byte("-ERR invalid password\r\n")
	MsgNoPasswordSet = []byte("-ERR Client sent AUTH, but no password is set\r\n")
	MsgParseError    = []byte("-ERR Command parse error (redis-proxy)\r\n")
)

Functions

func IsNetTimeout

func IsNetTimeout(err error) bool

Types

type Conn

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

func Dial

func Dial(proto, addr string, readTimeLimitMs int64, log bool) (*Conn, error)

func MustDial

func MustDial(proto, addr string, readTimeLimitMs int64, log bool) *Conn

func NewConn

func NewConn(rawConn net.Conn, readTimeLimitMs int64, log bool) *Conn

func (*Conn) Authenticate

func (rc *Conn) Authenticate(pass string) error

func (*Conn) Call

func (rc *Conn) Call(req *Msg) (*Msg, error)

func (*Conn) Close

func (rc *Conn) Close() error

func (*Conn) MustCall

func (rc *Conn) MustCall(req *Msg) *Msg

func (*Conn) MustCallAndGetOk

func (rc *Conn) MustCallAndGetOk(req *Msg)

func (*Conn) MustReadMsg

func (rc *Conn) MustReadMsg() *Msg

func (*Conn) MustWrite

func (rc *Conn) MustWrite(data []byte) int

func (*Conn) MustWriteMsg

func (rc *Conn) MustWriteMsg(msg *Msg) int

func (*Conn) Read

func (rc *Conn) Read(p []byte) (n int, err error)

func (*Conn) ReadMsg

func (rc *Conn) ReadMsg() (*Msg, error)

func (*Conn) RemoteAddr

func (rc *Conn) RemoteAddr() net.Addr

func (*Conn) Select

func (rc *Conn) Select(db int) error

func (*Conn) Write

func (rc *Conn) Write(data []byte) (int, error)

func (*Conn) WriteMsg

func (rc *Conn) WriteMsg(msg *Msg) (int, error)

type MessageOp

type MessageOp int

func (MessageOp) String

func (m MessageOp) String() string

type Msg

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

func MsgFromStrings

func MsgFromStrings(args ...string) *Msg

func NewMsg

func NewMsg(data []byte) *Msg

func (*Msg) Data

func (m *Msg) Data() []byte

func (*Msg) Equal

func (m *Msg) Equal(other *Msg) bool

func (*Msg) FirstArg

func (m *Msg) FirstArg() string

func (*Msg) FirstArgInt

func (m *Msg) FirstArgInt() int

func (*Msg) IsOk

func (m *Msg) IsOk() bool

func (*Msg) Op

func (m *Msg) Op() MessageOp

func (*Msg) String

func (m *Msg) String() string

Jump to

Keyboard shortcuts

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