Documentation
¶
Index ¶
- func BuildPrefixWithVersion(prefix string, version uint64) []byte
- func DecodeBytes(bz []byte) ([]byte, int, error)
- func DecodeUvarint(bz []byte) (uint64, int, error)
- func DecodeVarint(bz []byte) (int64, int, error)
- func EncodeBytes(w io.Writer, bz []byte) error
- func EncodeBytesSize(bz []byte) int
- func EncodeBytesSlice(bz []byte) ([]byte, error)
- func EncodeUvarint(w io.Writer, u uint64) error
- func EncodeUvarintSize(u uint64) int
- func EncodeVarint(w io.Writer, i int64) error
- func EncodeVarintSize(i int64) int
- func MarshalChangeset(cs *corestore.Changeset) ([]byte, error)
- func UnmarshalChangeset(cs *corestore.Changeset, buf []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPrefixWithVersion ¶
BuildPrefixWithVersion returns a byte slice with the given prefix and BigEndian encoded version. It is mainly used to represent the removed store key at the metadata store.
func DecodeBytes ¶
DecodeBytes decodes a varint length-prefixed byte slice, returning it along with the number of input bytes read. Assumes bz will not be mutated.
func DecodeUvarint ¶
DecodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the number of bytes decoded.
func DecodeVarint ¶
DecodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of bytes decoded.
func EncodeBytes ¶
EncodeBytes writes a varint length-prefixed byte slice to the writer.
func EncodeBytesSize ¶
EncodeBytesSize returns the byte size of the given slice including length-prefixing.
func EncodeBytesSlice ¶
EncodeBytesSlice length-prefixes the byte slice and returns it.
func EncodeUvarint ¶
EncodeUvarint writes a varint-encoded unsigned integer to an io.Writer.
func EncodeUvarintSize ¶
EncodeUvarintSize returns the byte size of the given integer as a varint.
func EncodeVarint ¶
EncodeVarint writes a varint-encoded integer to an io.Writer.
func EncodeVarintSize ¶
EncodeVarintSize returns the byte size of the given integer as a varint.
func MarshalChangeset ¶
MarshalChangeset returns the encoded byte representation of Changeset. NOTE: The Changeset is encoded as follows: - number of store keys (uvarint) - for each store key: -- store key (bytes) -- number of pairs (uvarint) -- for each pair: --- key (bytes) --- remove (1 byte) --- value (bytes)
Types ¶
This section is empty.