Documentation ¶
Index ¶
- Constants
- func CheckMarshalType(mt MarshalType) error
- func CheckPrecisionBits(precisionBits uint8) error
- func CompressZSTDLevel(dst, src []byte, compressLevel int) []byte
- func DecompressZSTD(dst, src []byte) ([]byte, error)
- func EnsureNonDecreasingSequence(a []int64, vMin, vMax int64)
- func MarshalBool(dst []byte, v bool) []byte
- func MarshalBytes(dst, b []byte) []byte
- func MarshalInt16(dst []byte, v int16) []byte
- func MarshalInt64(dst []byte, v int64) []byte
- func MarshalUint16(dst []byte, u uint16) []byte
- func MarshalUint32(dst []byte, u uint32) []byte
- func MarshalUint64(dst []byte, u uint64) []byte
- func MarshalVarInt64(dst []byte, v int64) []byte
- func MarshalVarInt64s(dst []byte, vs []int64) []byte
- func MarshalVarUint64(dst []byte, u uint64) []byte
- func MarshalVarUint64s(dst []byte, us []uint64) []byte
- func PutInt64s(is *Int64s)
- func PutUint32s(is *Uint32s)
- func PutUint64s(is *Uint64s)
- func UnmarshalBool(src []byte) bool
- func UnmarshalBytes(src []byte) ([]byte, []byte, error)
- func UnmarshalInt16(src []byte) int16
- func UnmarshalInt64(src []byte) int64
- func UnmarshalTimestamps(dst []int64, src []byte, mt MarshalType, firstTimestamp int64, itemsCount int) ([]int64, error)
- func UnmarshalUint16(src []byte) uint16
- func UnmarshalUint32(src []byte) uint32
- func UnmarshalUint64(src []byte) uint64
- func UnmarshalValues(dst []int64, src []byte, mt MarshalType, firstValue int64, itemsCount int) ([]int64, error)
- func UnmarshalVarInt64(src []byte) ([]byte, int64, error)
- func UnmarshalVarInt64s(dst []int64, src []byte) ([]byte, error)
- func UnmarshalVarUint64(src []byte) ([]byte, uint64, error)
- func UnmarshalVarUint64s(dst []uint64, src []byte) ([]byte, error)
- type Int64s
- type MarshalType
- type Uint32s
- type Uint64s
Constants ¶
const ( // MarshalTypeZSTDNearestDelta2 is used for marshaling counter // timeseries. MarshalTypeZSTDNearestDelta2 = MarshalType(1) // MarshalTypeDeltaConst is used for marshaling constantly changed // time series with constant delta. MarshalTypeDeltaConst = MarshalType(2) // MarshalTypeConst is used for marshaling time series containing only // a single constant. MarshalTypeConst = MarshalType(3) // MarshalTypeZSTDNearestDelta is used for marshaling gauge timeseries. MarshalTypeZSTDNearestDelta = MarshalType(4) // MarshalTypeNearestDelta2 is used instead of MarshalTypeZSTDNearestDelta2 // if compression doesn't help. MarshalTypeNearestDelta2 = MarshalType(5) // MarshalTypeNearestDelta is used instead of MarshalTypeZSTDNearestDelta // if compression doesn't help. MarshalTypeNearestDelta = MarshalType(6) )
Variables ¶
This section is empty.
Functions ¶
func CheckMarshalType ¶
func CheckMarshalType(mt MarshalType) error
CheckMarshalType verifies whether the mt is valid.
func CheckPrecisionBits ¶
CheckPrecisionBits makes sure precisionBits is in the range [1..64].
func CompressZSTDLevel ¶
CompressZSTDLevel appends compressed src to dst and returns the appended dst.
The given compressLevel is used for the compression.
func DecompressZSTD ¶
DecompressZSTD decompresses src, appends the result to dst and returns the appended dst.
func EnsureNonDecreasingSequence ¶
EnsureNonDecreasingSequence makes sure the first item in a is vMin, the last item in a is vMax and all the items in a are non-decreasing.
If this isn't the case then a is fixed accordingly.
func MarshalBool ¶ added in v1.92.0
MarshalBool appends marshaled v to dst and returns the result.
func MarshalBytes ¶
MarshalBytes appends marshaled b to dst and returns the result.
func MarshalInt16 ¶
MarshalInt16 appends marshaled v to dst and returns the result.
func MarshalInt64 ¶
MarshalInt64 appends marshaled v to dst and returns the result.
func MarshalUint16 ¶
MarshalUint16 appends marshaled v to dst and returns the result.
func MarshalUint32 ¶
MarshalUint32 appends marshaled v to dst and returns the result.
func MarshalUint64 ¶
MarshalUint64 appends marshaled v to dst and returns the result.
func MarshalVarInt64 ¶
MarshalVarInt64 appends marshalsed v to dst and returns the result.
func MarshalVarInt64s ¶
MarshalVarInt64s appends marshaled vs to dst and returns the result.
func MarshalVarUint64 ¶
MarshalVarUint64 appends marshaled u to dst and returns the result.
func MarshalVarUint64s ¶
MarshalVarUint64s appends marshaled us to dst and returns the result.
func UnmarshalBool ¶ added in v1.92.0
UnmarshalBool unmarshals bool from src.
func UnmarshalBytes ¶
UnmarshalBytes returns unmarshaled bytes from src.
func UnmarshalInt16 ¶
UnmarshalInt16 returns unmarshaled int16 from src.
func UnmarshalInt64 ¶
UnmarshalInt64 returns unmarshaled int64 from src.
func UnmarshalTimestamps ¶
func UnmarshalTimestamps(dst []int64, src []byte, mt MarshalType, firstTimestamp int64, itemsCount int) ([]int64, error)
UnmarshalTimestamps unmarshals timestamps from src, appends them to dst and returns the resulting dst.
firstTimestamp must be the timestamp returned from MarshalTimestamps.
func UnmarshalUint16 ¶
UnmarshalUint16 returns unmarshaled uint16 from src.
func UnmarshalUint32 ¶
UnmarshalUint32 returns unmarshaled uint32 from src.
func UnmarshalUint64 ¶
UnmarshalUint64 returns unmarshaled uint64 from src.
func UnmarshalValues ¶
func UnmarshalValues(dst []int64, src []byte, mt MarshalType, firstValue int64, itemsCount int) ([]int64, error)
UnmarshalValues unmarshals values from src, appends them to dst and returns the resulting dst.
firstValue must be the value returned from MarshalValues.
func UnmarshalVarInt64 ¶
UnmarshalVarInt64 returns unmarshaled int64 from src and returns the remaining tail from src.
func UnmarshalVarInt64s ¶
UnmarshalVarInt64s unmarshals len(dst) int64 values from src to dst and returns the remaining tail from src.
func UnmarshalVarUint64 ¶
UnmarshalVarUint64 returns unmarshaled uint64 from src and returns the remaining tail from src.
Types ¶
type MarshalType ¶
type MarshalType byte
MarshalType is the type used for the marshaling.
func MarshalTimestamps ¶
func MarshalTimestamps(dst []byte, timestamps []int64, precisionBits uint8) (result []byte, mt MarshalType, firstTimestamp int64)
MarshalTimestamps marshals timestamps, appends the marshaled result to dst and returns the dst.
timestamps must contain non-decreasing values.
precisionBits must be in the range [1...64], where 1 means 50% precision, while 64 means 100% precision, i.e. lossless encoding.
func MarshalValues ¶
func MarshalValues(dst []byte, values []int64, precisionBits uint8) (result []byte, mt MarshalType, firstValue int64)
MarshalValues marshals values, appends the marshaled result to dst and returns the dst.
precisionBits must be in the range [1...64], where 1 means 50% precision, while 64 means 100% precision, i.e. lossless encoding.
func (MarshalType) NeedsValidation ¶ added in v1.83.0
func (mt MarshalType) NeedsValidation() bool
NeedsValidation returns true if mt may need additional validation for silent data corruption.
type Uint32s ¶ added in v1.92.0
type Uint32s struct {
A []uint32
}
Uint32s holds an uint32 slice
func GetUint32s ¶ added in v1.92.0
GetUint32s returns an uint32 slice with the given size. The slize contents isn't initialized - it may contain garbage.