MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / DecodeDurationDescending

Function DecodeDurationDescending

pkg/util/encoding/encoding.go:1084–1106  ·  view source on GitHub ↗

DecodeDurationDescending is the descending version of DecodeDurationAscending.

(b []byte)

Source from the content-addressed store, hash-verified

1082
1083// DecodeDurationDescending is the descending version of DecodeDurationAscending.
1084func DecodeDurationDescending(b []byte) ([]byte, duration.Duration, error) {
1085 if PeekType(b) != Duration {
1086 return nil, duration.Duration{}, errors.Errorf("did not find marker")
1087 }
1088 b = b[1:]
1089 b, sortNanos, err := DecodeVarintDescending(b)
1090 if err != nil {
1091 return b, duration.Duration{}, err
1092 }
1093 b, months, err := DecodeVarintDescending(b)
1094 if err != nil {
1095 return b, duration.Duration{}, err
1096 }
1097 b, days, err := DecodeVarintDescending(b)
1098 if err != nil {
1099 return b, duration.Duration{}, err
1100 }
1101 d, err := duration.Decode(sortNanos, months, days)
1102 if err != nil {
1103 return b, duration.Duration{}, err
1104 }
1105 return b, d, nil
1106}
1107
1108// EncodeBitArrayAscending encodes a bitarray.BitArray value, appends it to the
1109// supplied buffer, and returns the final buffer. The encoding is guaranteed to

Callers 1

prettyPrintFirstValueFunction · 0.85

Calls 3

DecodeFunction · 0.92
PeekTypeFunction · 0.85
DecodeVarintDescendingFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…