Documentation ¶
Overview ¶
Package core is RDB core core
Index ¶
- Constants
- func RandString(n int) string
- type Decoder
- type Encoder
- func (enc *Encoder) EnableCompress() *Encoder
- func (enc *Encoder) SetHashZipListOpt(maxValue, maxEntries int) *Encoder
- func (enc *Encoder) SetListZipListOpt(maxValue, maxEntries int) *Encoder
- func (enc *Encoder) SetZSetZipListOpt(maxValue, maxEntries int) *Encoder
- func (enc *Encoder) WriteAux(key, value string) error
- func (enc *Encoder) WriteDBHeader(dbIndex uint, keyCount, ttlCount uint64) error
- func (enc *Encoder) WriteEnd() error
- func (enc *Encoder) WriteHashMapObject(key string, hash map[string][]byte, options ...interface{}) error
- func (enc *Encoder) WriteHeader() error
- func (enc *Encoder) WriteListObject(key string, values [][]byte, options ...interface{}) error
- func (enc *Encoder) WriteSetObject(key string, values [][]byte, options ...interface{}) error
- func (enc *Encoder) WriteStringObject(key string, value []byte, options ...interface{}) error
- func (enc *Encoder) WriteZSetObject(key string, entries []*model.ZSetEntry, options ...interface{}) error
- type ModuleTypeHandleFunc
- type ModuleTypeHandler
- type TTLOption
Constants ¶
View Source
const ( OpcodeEOF = 0 OpcodeSInt = 1 OpcodeUInt = 2 OpcodeFloat = 3 OpcodeDouble = 4 OpcodeString = 5 )
View Source
const ( // StreamItemFlagNone means No special flags. StreamItemFlagNone = 0 // StreamItemFlagDeleted means entry was deleted StreamItemFlagDeleted = 1 << 0 // StreamItemFlagSameFields means entry has the same fields as the master entry StreamItemFlagSameFields = 1 << 1 )
View Source
const ModuleTypeNameCharSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is an instance of rdb parsing process
func (*Decoder) GetReadCount ¶
func (*Decoder) Parse ¶
func (dec *Decoder) Parse(cb func(object model.RedisObject) bool) (err error)
Parse parses rdb and callback cb returns true to continue, returns false to stop the iteration
func (*Decoder) WithSpecialOpCode ¶
WithSpecialOpCode enables returning model.AuxObject to callback
func (*Decoder) WithSpecialType ¶
func (dec *Decoder) WithSpecialType(moduleType string, f ModuleTypeHandleFunc) *Decoder
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is used to generate RDB file
func (*Encoder) EnableCompress ¶
remain unfixed bugs, don't open
func (*Encoder) SetHashZipListOpt ¶
SetHashZipListOpt sets hash-max-ziplist-value and hash-max-ziplist-entries
func (*Encoder) SetListZipListOpt ¶
SetListZipListOpt sets list-max-ziplist-value and list-max-ziplist-entries
func (*Encoder) SetZSetZipListOpt ¶
SetZSetZipListOpt sets zset-max-ziplist-value and zset-max-ziplist-entries
func (*Encoder) WriteDBHeader ¶
WriteDBHeader write db index and resize db into rdb file
func (*Encoder) WriteHashMapObject ¶
func (*Encoder) WriteHeader ¶
func (*Encoder) WriteListObject ¶
func (*Encoder) WriteSetObject ¶
func (*Encoder) WriteStringObject ¶
type ModuleTypeHandleFunc ¶
type ModuleTypeHandleFunc func(handler ModuleTypeHandler, encVersion int) (interface{}, error)
type ModuleTypeHandler ¶
Click to show internal directories.
Click to hide internal directories.