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

Function DecodeUntaggedDurationValue

pkg/util/encoding/encoding.go:3106–3121  ·  view source on GitHub ↗

DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue.

(b []byte)

Source from the content-addressed store, hash-verified

3104
3105// DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue.
3106func DecodeUntaggedDurationValue(b []byte) (remaining []byte, d duration.Duration, err error) {
3107 var months, days, nanos int64
3108 b, _, months, err = DecodeNonsortingStdlibVarint(b)
3109 if err != nil {
3110 return b, duration.Duration{}, err
3111 }
3112 b, _, days, err = DecodeNonsortingStdlibVarint(b)
3113 if err != nil {
3114 return b, duration.Duration{}, err
3115 }
3116 b, _, nanos, err = DecodeNonsortingStdlibVarint(b)
3117 if err != nil {
3118 return b, duration.Duration{}, err
3119 }
3120 return b, duration.DecodeDuration(months, days, nanos), nil
3121}
3122
3123// DecodeBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.
3124func 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…