Documentation ¶
Overview ¶
Package rdb implements parsing and encoding of the Redis RDB file format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder interface { // StartRDB is called when parsing of a valid RDB file starts. StartRDB(ver int) // StartDatabase is called when database n starts. // Once a database starts, another database will not start until EndDatabase is called. StartDatabase(n int) // AUX field Aux(key, value []byte) // ResizeDB hint ResizeDatabase(dbSize, expiresSize uint32) // Set is called once for each string key. Set(key, value []byte, expiry int64, info *Info) // StartHash is called at the beginning of a hash. // Hset will be called exactly length times before EndHash. StartHash(key []byte, length, expiry int64, info *Info) // Hset is called once for each field=value pair in a hash. Hset(key, field, value []byte) // EndHash is called when there are no more fields in a hash. EndHash(key []byte) // StartSet is called at the beginning of a set. // Sadd will be called exactly cardinality times before EndSet. StartSet(key []byte, cardinality, expiry int64, info *Info) // Sadd is called once for each member of a set. Sadd(key, member []byte) // EndSet is called when there are no more fields in a set. EndSet(key []byte) // StartStream is called at the beginning of a stream. // Xadd will be called exactly length times before EndStream. StartStream(key []byte, cardinality, expiry int64, info *Info) // Xadd is called once for each id in a stream. Xadd(key, id, listpack []byte) // EndHash is called when there are no more fields in a hash. EndStream(key []byte, items uint64, lastEntryID string, cgroupsData StreamGroups) // StartList is called at the beginning of a list. // Rpush will be called exactly length times before EndList. // If length of the list is not known, then length is -1 StartList(key []byte, length, expiry int64, info *Info) // Rpush is called once for each value in a list. Rpush(key, value []byte) // EndList is called when there are no more values in a list. EndList(key []byte) // StartZSet is called at the beginning of a sorted set. // Zadd will be called exactly cardinality times before EndZSet. StartZSet(key []byte, cardinality, expiry int64, info *Info) // Zadd is called once for each member of a sorted set. Zadd(key []byte, score float64, member []byte) // EndZSet is called when there are no more members in a sorted set. EndZSet(key []byte) // EndDatabase is called at the end of a database. EndDatabase(n int) // EndRDB is called when parsing of the RDB file is complete. EndRDB() }
A Decoder must be implemented to parse a RDB file.
type StreamConsumerData ¶
type StreamConsumerData struct { Name []byte SeenTime uint64 Pending []*StreamConsumerPendingEntry }
type StreamConsumerPendingEntry ¶
type StreamConsumerPendingEntry struct {
ID []byte
}
type StreamGroup ¶
type StreamGroup struct { Name []byte LastEntryId string Pending []*StreamPendingEntry Consumers []*StreamConsumerData }
type StreamGroups ¶
type StreamGroups []*StreamGroup
type StreamPendingEntry ¶
type ValueType ¶
type ValueType byte
ValueType of redis type
const ( TypeString ValueType = 0 TypeList ValueType = 1 TypeSet ValueType = 2 TypeZSet ValueType = 3 TypeHash ValueType = 4 TypeZSet2 ValueType = 5 TypeModule ValueType = 6 TypeModule2 ValueType = 7 TypeHashZipmap ValueType = 9 TypeListZiplist ValueType = 10 TypeSetIntset ValueType = 11 TypeZSetZiplist ValueType = 12 TypeHashZiplist ValueType = 13 TypeListQuicklist ValueType = 14 TypeStreamListPacks ValueType = 15 )
type value
Directories ¶
Path | Synopsis |
---|---|
Package crc64 implements the Jones coefficients with an init value of 0.
|
Package crc64 implements the Jones coefficients with an init value of 0. |
This is a very basic example of a program that implements rdb.decoder and outputs a human readable diffable dump of the rdb file.
|
This is a very basic example of a program that implements rdb.decoder and outputs a human readable diffable dump of the rdb file. |
Click to show internal directories.
Click to hide internal directories.