Documentation ¶
Index ¶
- Constants
- Variables
- func FormatFloat64(s string) (float64, error)
- func FormatInt64(s string) (int64, error)
- func Serve(addr string, handler HandlerFunc) error
- type Command
- type Conn
- type HandlerFunc
- type Options
- type Reader
- type Writer
- func (w *Writer) Bytes() []byte
- func (w *Writer) Flush() error
- func (w *Writer) HasError() bool
- func (w *Writer) RemoteAddr() string
- func (w *Writer) WriteArray(l int)
- func (w *Writer) WriteArrayNull()
- func (w *Writer) WriteBulk(bulk string)
- func (w *Writer) WriteBulkNull()
- func (w *Writer) WriteDouble(v float64)
- func (w *Writer) WriteError(err string)
- func (w *Writer) WriteInt64(v int64)
- func (w *Writer) WriteMap(n int)
- func (w *Writer) WriteNullMap()
- func (w *Writer) WriteOK()
- func (w *Writer) WriteString(str string)
- func (w *Writer) WriteUInt64(v uint64)
Constants ¶
View Source
const ( StringType = '+' ErrType = '-' IntegerType = ':' BulkType = '$' ArrayType = '*' MapType = '%' DoubleType = ',' NullType = '_' )
View Source
const ( MultiNone uint8 = 0 MultiPrepare uint8 = 1 MultiCommit uint8 = 2 MultiError uint8 = 4 )
Variables ¶
View Source
var ( ErrInvalidRequestExceptedArray = errors.New("invalid request, expected array") ErrInvalidRequestExceptedArrayLength = errors.New("invalid request, expected array length") ErrInvalidRequestExceptedBulk = errors.New("invalid request, expected bulk") )
View Source
var ClientNum atomic.Int64
Functions ¶
func FormatFloat64 ¶ added in v1.6.0
func FormatInt64 ¶ added in v1.6.0
func Serve ¶
func Serve(addr string, handler HandlerFunc) error
Types ¶
type HandlerFunc ¶ added in v1.6.0
type Options ¶ added in v1.6.0
type Options struct { NX int XX int KEEPTTL int GET int LT int GT int CH int INCR int WITHSCORES int EX int PX int EXAT int PXAT int MATCH int COUNT int BYLEX int BYSCORE int LIMIT int BYTE int BIT int NUMKEYS int WEIGHTS int AGGREGATE int REV int TYPE int M int KM int FT int MI int ASC int DESC int ANY int WITHCOORD int WITHDIST int WITHHASH int }
type Reader ¶ added in v1.6.0
type Reader struct {
// contains filtered or unexported fields
}
func (*Reader) ReadCommand ¶ added in v1.6.0
func (*Reader) ReadInlineCommand ¶ added in v1.6.0
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a RESP writer
func (*Writer) RemoteAddr ¶ added in v1.6.0
func (*Writer) WriteArray ¶ added in v1.6.0
func (*Writer) WriteArrayNull ¶ added in v1.6.0
func (w *Writer) WriteArrayNull()
func (*Writer) WriteBulkNull ¶ added in v1.6.0
func (w *Writer) WriteBulkNull()
func (*Writer) WriteDouble ¶ added in v1.6.0
func (*Writer) WriteError ¶ added in v1.6.0
func (*Writer) WriteInt64 ¶ added in v1.8.0
func (*Writer) WriteNullMap ¶ added in v1.6.0
func (w *Writer) WriteNullMap()
func (*Writer) WriteString ¶ added in v1.6.0
func (*Writer) WriteUInt64 ¶ added in v1.8.0
Click to show internal directories.
Click to hide internal directories.