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

Function DecodeUntaggedDurationValue

pkg/util/encoding/encoding.go:2225–2240  ·  view source on GitHub ↗

DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue.

(b []byte)

Source from the content-addressed store, hash-verified

2223
2224// DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue.
2225func DecodeUntaggedDurationValue(b []byte) (remaining []byte, d duration.Duration, err error) {
2226 var months, days, nanos int64
2227 b, _, months, err = DecodeNonsortingStdlibVarint(b)
2228 if err != nil {
2229 return b, duration.Duration{}, err
2230 }
2231 b, _, days, err = DecodeNonsortingStdlibVarint(b)
2232 if err != nil {
2233 return b, duration.Duration{}, err
2234 }
2235 b, _, nanos, err = DecodeNonsortingStdlibVarint(b)
2236 if err != nil {
2237 return b, duration.Duration{}, err
2238 }
2239 return b, duration.DecodeDuration(months, days, nanos), nil
2240}
2241
2242// DecodeBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.
2243func DecodeBitArrayValue(b []byte) (remaining []byte, d bitarray.BitArray, err error) {

Callers 1

DecodeDurationValueFunction · 0.85

Calls 2

DecodeDurationFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…