Documentation
¶
Index ¶
- Constants
- Variables
- func AbbreviatedKey(key []byte) uint64
- func Compare(a, b []byte) int
- func ConvertToTimestamp(x int64) time.Time
- func DecodeBoolean(b []byte) bool
- func DecodeBytea(b []byte) ([]byte, int)
- func DecodeFloat(b []byte) (float64, int)
- func DecodeFloat64(b []byte) float64
- func DecodeInt(b []byte) (int64, int)
- func DecodeInt16(b []byte) int16
- func DecodeInt32(b []byte) int32
- func DecodeInt64(b []byte) int64
- func DecodeInt8(b []byte) int8
- func DecodeText(b []byte) (string, int)
- func DecodeTimestamp(b []byte) (time.Time, int)
- func DecodeUint16(b []byte) uint16
- func DecodeUint32(b []byte) uint32
- func DecodeUint64(b []byte) uint64
- func DecodeUint8(b []byte) uint8
- func Desc(dst []byte, n int) ([]byte, int)
- func EncodeBoolean(dst []byte, x bool) []byte
- func EncodeBytea(dst []byte, x []byte) []byte
- func EncodeFloat(dst []byte, x float64) []byte
- func EncodeFloat64(dst []byte, x float64) []byte
- func EncodeInt(dst []byte, n int64) []byte
- func EncodeInt16(dst []byte, n int16) []byte
- func EncodeInt32(dst []byte, n int32) []byte
- func EncodeInt64(dst []byte, n int64) []byte
- func EncodeInt8(dst []byte, n int8) []byte
- func EncodeNull(dst []byte) []byte
- func EncodeText(dst []byte, x string) []byte
- func EncodeTimestamp(dst []byte, t time.Time) []byte
- func EncodeUint(dst []byte, n uint64) []byte
- func EncodeUint16(dst []byte, n uint16) []byte
- func EncodeUint32(dst []byte, n uint32) []byte
- func EncodeUint64(dst []byte, n uint64) []byte
- func EncodeUint8(dst []byte, n uint8) []byte
- func Equal(a, b []byte) bool
- func Separator(dst, a, b []byte) []byte
- func Skip(b []byte) int
- func SkipArray(b []byte) int
- func SkipObject(b []byte) int
- func Split(k []byte) int
Constants ¶
const ( TombstoneValue byte = 0 // Null NullValue byte = 2 // Booleans FalseValue byte = 5 TrueValue byte = 6 // Negative integers Int64Value byte = 12 Int32Value byte = 13 Int16Value byte = 14 Int8Value byte = 15 // Contiguous block of 64 integers. // Types from 16 to 79 represent // values from -32 to 31 IntSmallValue byte = 16 // Positive integers Uint8Value byte = 80 Uint16Value byte = 81 Uint32Value byte = 82 Uint64Value byte = 83 // Floating point numbers Float64Value byte = 90 // Text TextValue byte = 98 // Binary ByteaValue byte = 103 // Arrays ArrayValue byte = 110 // Objects ObjectValue byte = 120 // DESC_ prefix means that the value is encoded in reverse order. DESC_ObjectValue byte = 255 - ObjectValue DESC_ArrayValue byte = 255 - ArrayValue DESC_ByteaValue byte = 255 - ByteaValue DESC_TextValue byte = 255 - TextValue DESC_Float64Value byte = 255 - Float64Value DESC_Uint64Value byte = 255 - Uint64Value DESC_Uint32Value byte = 255 - Uint32Value DESC_Uint16Value byte = 255 - Uint16Value DESC_Uint8Value byte = 255 - Uint8Value DESC_IntSmallValue byte = 255 - IntSmallValue DESC_Int8Value byte = 255 - Int8Value DESC_Int16Value byte = 255 - Int16Value DESC_Int32Value byte = 255 - Int32Value DESC_Int64Value byte = 255 - Int64Value DESC_TrueValue byte = 255 - TrueValue DESC_FalseValue byte = 255 - FalseValue DESC_NullValue byte = 255 - NullValue )
Types used to encode values in the tree. They are sorted from the smallest to largest. Each type is encoded on 1 byte and describes two things: - the type of the field - the sort order of the field (ASC or DESC) The first 128 values are used for ASC order, the last 128 values are used for DESC order. A block of 64 is reserved for small integers in the range [-32, 31]. Gaps are left between each type to allow adding new types in the future.
Variables ¶
Functions ¶
func AbbreviatedKey ¶
AbbreviatedKey returns a shortened version that is used for comparing keys during indexed batch comparisons. The key is not guaranteed to be unique, but it respects the same ordering as the original key. If two abbreviated keys are equal, Pebble will call the Equal function to determine if the original keys are equal. The key is constructed as follows: - 12 bits: the namespace, from 0 to 4096. If bigger than 4096, returns math.MaxUint64. - 4 bits: the Chai type of the first value. - 48 bits: a representation of the first value of the key, depending on its type.
func ConvertToTimestamp ¶
func DecodeBoolean ¶
func DecodeBytea ¶ added in v0.18.0
func DecodeFloat ¶
func DecodeFloat64 ¶
func DecodeInt16 ¶
func DecodeInt32 ¶
func DecodeInt64 ¶
func DecodeInt8 ¶
func DecodeText ¶
func DecodeUint16 ¶
func DecodeUint32 ¶
func DecodeUint64 ¶
func DecodeUint8 ¶
func Desc ¶
Desc changes the type of the encoded value to its descending counterpart. It is meant to be used in combination with one of the Encode* functions.
var buf []byte buf, n = encoding.Desc(encoding.EncodeInt(buf, 10))
func EncodeBoolean ¶
func EncodeBytea ¶ added in v0.18.0
func EncodeFloat ¶
func EncodeFloat64 ¶
func EncodeInt16 ¶
func EncodeInt32 ¶
func EncodeInt64 ¶
func EncodeInt8 ¶
func EncodeNull ¶
func EncodeText ¶
func EncodeUint ¶
func EncodeUint16 ¶
func EncodeUint32 ¶
func EncodeUint64 ¶
func EncodeUint8 ¶
func SkipObject ¶
Types ¶
This section is empty.