ledisdb/ledis/const.go

68 lines
1.2 KiB
Go
Raw Normal View History

2014-05-16 11:04:35 +04:00
package ledis
2014-05-20 04:41:24 +04:00
import (
"errors"
)
2014-05-16 11:04:35 +04:00
const (
kvType byte = iota + 1
hashType
hSizeType
listType
lMetaType
zsetType
zSizeType
zScoreType
kvExpType
kvExpMetaType
lExpType
lExpMetaType
hExpType
hExpMetaType
zExpType
zExpMetaType
2014-05-16 11:04:35 +04:00
)
2014-05-20 04:41:24 +04:00
2014-05-23 07:44:50 +04:00
const (
defaultScanCount int = 10
2014-05-23 07:44:50 +04:00
)
2014-06-05 11:46:38 +04:00
var (
errKeySize = errors.New("invalid key size")
errValueSize = errors.New("invalid value size")
errHashFieldSize = errors.New("invalid hash field size")
errZSetMemberSize = errors.New("invalid zset member size")
errExpireValue = errors.New("invalid expire value")
)
2014-05-20 04:41:24 +04:00
const (
//we don't support too many databases
MaxDBNumber uint8 = 16
//max key size
MaxKeySize int = 1024
2014-05-20 04:41:24 +04:00
//max hash field size
MaxHashFieldSize int = 1024
2014-05-20 04:41:24 +04:00
//max zset member size
MaxZSetMemberSize int = 1024
//max value size
MaxValueSize int = 10 * 1024 * 1024
2014-05-20 04:41:24 +04:00
)
var (
ErrKeySize = errors.New("invalid key size")
ErrHashFieldSize = errors.New("invalid hash field size")
ErrZSetMemberSize = errors.New("invalid zset member size")
2014-06-05 10:21:50 +04:00
ErrScoreMiss = errors.New("zset score miss")
2014-05-20 04:41:24 +04:00
)
2014-05-27 12:05:24 +04:00
const (
BinLogTypeDeletion uint8 = 0x0
2014-05-29 11:07:14 +04:00
BinLogTypePut uint8 = 0x1
BinLogTypeCommand uint8 = 0x2
2014-05-27 12:05:24 +04:00
)