2014-05-16 11:03:23 +04:00
|
|
|
package server
|
2014-05-02 13:08:20 +04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
2015-05-04 17:42:28 +03:00
|
|
|
|
2020-04-24 09:10:03 +03:00
|
|
|
"github.com/ledisdb/ledisdb/ledis"
|
2014-05-02 13:08:20 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2015-09-13 03:47:10 +03:00
|
|
|
ErrEmptyCommand = errors.New("empty command")
|
|
|
|
ErrNotFound = errors.New("command not found")
|
|
|
|
ErrNotAuthenticated = errors.New("not authenticated")
|
|
|
|
ErrAuthenticationFailure = errors.New("authentication failure")
|
|
|
|
ErrCmdParams = errors.New("invalid command param")
|
|
|
|
ErrValue = errors.New("value is not an integer or out of range")
|
|
|
|
ErrSyntax = errors.New("syntax error")
|
|
|
|
ErrOffset = errors.New("offset bit is not an natural number")
|
|
|
|
ErrBool = errors.New("value is not 0 or 1")
|
2014-05-02 13:08:20 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
Delims = []byte("\r\n")
|
|
|
|
|
|
|
|
NullBulk = []byte("-1")
|
|
|
|
NullArray = []byte("-1")
|
2014-05-03 10:55:12 +04:00
|
|
|
|
2014-12-01 12:50:48 +03:00
|
|
|
PONG = "PONG"
|
|
|
|
OK = "OK"
|
|
|
|
NOKEY = "NOKEY"
|
2014-05-02 13:08:20 +04:00
|
|
|
)
|
2014-08-25 10:18:23 +04:00
|
|
|
|
|
|
|
const (
|
2015-03-02 06:10:54 +03:00
|
|
|
KV ledis.DataType = ledis.KV
|
|
|
|
LIST = ledis.LIST
|
|
|
|
HASH = ledis.HASH
|
|
|
|
SET = ledis.SET
|
|
|
|
ZSET = ledis.ZSET
|
2014-08-25 10:18:23 +04:00
|
|
|
)
|
|
|
|
|
2015-03-07 07:47:35 +03:00
|
|
|
const (
|
|
|
|
KVName = ledis.KVName
|
|
|
|
ListName = ledis.ListName
|
|
|
|
HashName = ledis.HashName
|
|
|
|
SetName = ledis.SetName
|
|
|
|
ZSetName = ledis.ZSetName
|
|
|
|
)
|
|
|
|
|
2014-08-25 10:18:23 +04:00
|
|
|
const (
|
|
|
|
GB uint64 = 1024 * 1024 * 1024
|
|
|
|
MB uint64 = 1024 * 1024
|
|
|
|
KB uint64 = 1024
|
|
|
|
)
|
2015-03-07 11:51:27 +03:00
|
|
|
|
|
|
|
var TypeNames = []string{KVName, ListName, HashName, SetName, ZSetName}
|