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

Function EncodeDurationDescending

pkg/util/encoding/encoding.go:1042–1054  ·  view source on GitHub ↗

EncodeDurationDescending is the descending version of EncodeDurationAscending.

(b []byte, d duration.Duration)

Source from the content-addressed store, hash-verified

1040
1041// EncodeDurationDescending is the descending version of EncodeDurationAscending.
1042func EncodeDurationDescending(b []byte, d duration.Duration) ([]byte, error) {
1043 sortNanos, months, days, err := d.Encode()
1044 if err != nil {
1045 // TODO(dan): Handle this using d.EncodeBigInt() and the
1046 // durationBigNeg/durationBigPos markers.
1047 return b, err
1048 }
1049 b = append(b, durationMarker)
1050 b = EncodeVarintDescending(b, sortNanos)
1051 b = EncodeVarintDescending(b, months)
1052 b = EncodeVarintDescending(b, days)
1053 return b, nil
1054}
1055
1056// DecodeDurationAscending decodes a duration.Duration value which was encoded
1057// using EncodeDurationAscending. The remainder of the input buffer and the

Callers

nothing calls this directly

Calls 2

EncodeVarintDescendingFunction · 0.85
EncodeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…