package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# Packages

Package csv reads and writes comma-separated values (CSV) files.

# Functions

AddJSONPathSeparator adds a json path separator to a byte array.
AddJSONPathTerminator adds a json path terminator to a byte array.
BytesNext returns the next possible byte slice, using the extra capacity of the provided slice if possible, and if not, appending an \x00.
BytesPrevish returns a previous byte slice in lexicographical ordering.
DecodeBitArrayAscending decodes a bit array which was encoded using EncodeBitArrayAscending.
DecodeBitArrayDescending is the descending version of DecodeBitArrayAscending.
DecodeBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.
DecodeBoolValue decodes a value encoded by EncodeBoolValue.
DecodeBox2DAscending decodes a box2D object in ascending order.
DecodeBox2DDescending decodes a box2D object in descending order.
DecodeBytesAscending decodes a []byte value from the input buffer which was encoded using EncodeBytesAscending.
DecodeBytesAscendingDeepCopy is the same as DecodeBytesAscending, but the decoded []byte will never alias memory of b.
DecodeBytesDescending decodes a []byte value from the input buffer which was encoded using EncodeBytesDescending.
DecodeBytesValue decodes a value encoded by EncodeBytesValue.
DecodeDecimalAscending returns the remaining byte slice after decoding and the decoded decimal from buf.
DecodeDecimalDescending decodes decimals encoded with EncodeDecimalDescending.
DecodeDecimalValue decodes a value encoded by EncodeDecimalValue.
DecodeDurationAscending decodes a duration.Duration value which was encoded using EncodeDurationAscending.
DecodeDurationDescending is the descending version of DecodeDurationAscending.
DecodeDurationValue decodes a value encoded by EncodeUntaggedDurationValue.
DecodeFloatAscending returns the remaining byte slice after decoding and the decoded float64 from buf.
DecodeFloatDescending decodes floats encoded with EncodeFloatDescending.
DecodeFloatValue decodes a value encoded by EncodeFloatValue.
DecodeGeoAscending decodes a geopb.SpatialObject value that was encoded in ascending order back into a geopb.SpatialObject.
DecodeGeoDescending decodes a geopb.SpatialObject value that was encoded in descending order back into a geopb.SpatialObject.
DecodeGeoInvertedKey decodes the bounding box from the geo inverted key.
DecodeIfNotNull decodes a not-NULL value from the input buffer.
DecodeIfNull decodes a NULL value from the input buffer.
DecodeIntoNonsortingDecimal is like DecodeNonsortingDecimal, but it operates on the passed-in *apd.Decimal instead of producing a new one.
DecodeIntoUntaggedDecimalValue is like DecodeUntaggedDecimalValue except it writes the new Decimal into the input apd.Decimal pointer, which must be non-nil.
DecodeIntValue decodes a value encoded by EncodeIntValue.
DecodeIPAddrValue decodes a value encoded by EncodeIPAddrValue.
DecodeNonsortingDecimal returns the decoded decimal from buf encoded with EncodeNonsortingDecimal.
DecodeNonsortingStdlibUvarint decodes a value encoded with binary.PutUvarint.
DecodeNonsortingStdlibVarint decodes a value encoded by EncodeNonsortingVarint.
DecodeNonsortingUvarint decodes a value encoded by EncodeNonsortingUvarint.
DecodeTimeAscending decodes a time.Time value which was encoded using EncodeTime.
DecodeTimeDescending is the descending version of DecodeTimeAscending.
DecodeTimeTZAscending decodes a timetz.TimeTZ value which was encoded using encodeTimeTZ.
DecodeTimeTZDescending is the descending version of DecodeTimeTZAscending.
DecodeTimeTZValue decodes a value encoded by EncodeTimeTZValue.
DecodeTimeValue decodes a value encoded by EncodeTimeValue.
DecodeUint16Ascending decodes a uint16 from the input buffer, treating the input as a big-endian 2 byte uint16 representation.
DecodeUint32Ascending decodes a uint32 from the input buffer, treating the input as a big-endian 4 byte uint32 representation.
DecodeUint32Descending decodes a uint32 value which was encoded using EncodeUint32Descending.
DecodeUint64Ascending decodes a uint64 from the input buffer, treating the input as a big-endian 8 byte uint64 representation.
DecodeUint64Descending decodes a uint64 value which was encoded using EncodeUint64Descending.
DecodeUnsafeStringAscending decodes a string value from the input buffer which was encoded using EncodeString or EncodeBytes.
DecodeUnsafeStringAscendingDeepCopy is the same as DecodeUnsafeStringAscending but the returned string will never share storage with the input buffer.
DecodeUnsafeStringDescending decodes a string value from the input buffer which was encoded using EncodeStringDescending or EncodeBytesDescending.
DecodeUntaggedBitArrayValue decodes a value encoded by EncodeUntaggedBitArrayValue.
DecodeUntaggedBox2DValue decodes a value encoded by EncodeUntaggedBox2DValue.
DecodeUntaggedBytesValue decodes a value encoded by EncodeUntaggedBytesValue.
DecodeUntaggedDecimalValue decodes a value encoded by EncodeUntaggedDecimalValue.
DecodeUntaggedDurationValue decodes a value encoded by EncodeUntaggedDurationValue.
DecodeUntaggedFloat32Value decodes a value encoded by EncodeUntaggedFloat32Value.
DecodeUntaggedFloatValue decodes a value encoded by EncodeUntaggedFloatValue.
DecodeUntaggedGeoValue decodes a value encoded by EncodeUntaggedGeoValue into the provided geopb.SpatialObject reference.
DecodeUntaggedIntValue decodes a value encoded by EncodeUntaggedIntValue.
DecodeUntaggedIPAddrValue decodes a value encoded by EncodeUntaggedIPAddrValue.
DecodeUntaggedTimeTZValue decodes a value encoded by EncodeUntaggedTimeTZValue.
DecodeUntaggedTimeValue decodes a value encoded by EncodeUntaggedTimeValue.
DecodeUntaggedUUIDValue decodes a value encoded by EncodeUntaggedUUIDValue.
DecodeUUIDValue decodes a value encoded by EncodeUUIDValue.
DecodeUvarintAscending decodes a uint64 encoded uint64 from the input buffer.
DecodeUvarintDescending decodes a uint64 value which was encoded using EncodeUvarintDescending.
DecodeValueTag decodes a value encoded by EncodeValueTag, used as a prefix in each of the other EncodeFooValue methods.
DecodeVarintAscending decodes a value encoded by EncodeVarintAscending.
DecodeVarintDescending decodes a int64 value which was encoded using EncodeVarintDescending.
DecodeVoidAscendingOrDescending decodes a void (valid for both ascending and descending order).
EncLenUvarintAscending returns the encoding length for EncodeUvarintAscending without actually encoding.
EncLenUvarintDescending returns the encoding length for EncodeUvarintDescending without actually encoding.
EncodeArrayAscending encodes a value used to signify membership of an array for JSON objects.
EncodeArrayKeyMarker adds the array key encoding marker to buf and returns the new buffer.
EncodeArrayKeyTerminator adds the array key terminator to buf and returns the new buffer.
EncodeArrayValue encodes a byte array value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeBitArrayAscending encodes a bitarray.BitArray value, appends it to the supplied buffer, and returns the final buffer.
EncodeBitArrayDescending is the descending version of EncodeBitArrayAscending.
EncodeBitArrayValue encodes a bit array value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeBoolValue encodes a bool value, appends it to the supplied buffer, and returns the final buffer.
EncodeBox2DAscending encodes a bounding box in ascending order.
EncodeBox2DDescending encodes a bounding box in descending order.
EncodeBox2DValue encodes a geopb.BoundingBox with its value tag, appends it to the supplied buffer and returns the final buffer.
EncodeBytesAscending encodes the []byte value using an escape-based encoding.
EncodeBytesDescending encodes the []byte value using an escape-based encoding and then inverts (ones complement) the result so that it sorts in reverse order, from larger to smaller lexicographically.
EncodeBytesSize returns the size of the []byte value when encoded using EncodeBytes{Ascending,Descending}.
EncodeBytesValue encodes a byte array value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeDecimalAscending returns the resulting byte slice with the encoded decimal appended to the given buffer.
EncodeDecimalDescending is the descending version of EncodeDecimalAscending.
EncodeDecimalValue encodes an apd.Decimal value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodedLengthUvarintAscending returns the length of the variable length representation, i.e.
EncodeDurationAscending encodes a duration.Duration value, appends it to the supplied buffer, and returns the final buffer.
EncodeDurationDescending is the descending version of EncodeDurationAscending.
EncodeDurationValue encodes a duration.Duration value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeEmptyArray returns a byte array b with a byte to signify an empty array.
EncodeFalseAscending encodes the boolean value false for use with JSON inverted indexes.
EncodeFloatAscending returns the resulting byte slice with the encoded float64 appended to b.
EncodeFloatDescending is the descending version of EncodeFloatAscending.
EncodeFloatValue encodes a float value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeGeoAscending encodes a geopb.SpatialObject value in ascending order and returns the new buffer.
EncodeGeoDescending encodes a geopb.SpatialObject value in descending order and returns the new buffer.
EncodeGeoInvertedAscending appends the geoInvertedIndexMarker.
EncodeGeoInvertedBBox encodes the bounding box for the geo inverted index.
EncodeGeoValue encodes a geopb.SpatialObject value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeIntValue encodes an int value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeIPAddrValue encodes a ipaddr.IPAddr value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeJSONArrayKeyMarker adds a JSON Array key encoding marker to buf and returns the new buffer.
EncodeJSONAscending encodes a JSON Type.
EncodeJSONEmptyArray returns a byte array b with a byte to signify an empty JSON array.
EncodeJSONEmptyObject returns a byte array b with a byte to signify an empty JSON object.
EncodeJSONFalseKeyMarker adds a JSON False key encoding marker to buf and returns the new buffer.
EncodeJSONKeyStringAscending encodes the JSON key string value with a JSON specific escaped terminator.
EncodeJSONKeyTerminator adds a JSON Key terminator to buf and returns the buffer.
EncodeJSONNullKeyMarker adds a JSON Null key encoding marker to buf and returns the new buffer.
EncodeJSONNumberKeyMarker adds a JSON Number key encoding marker to buf and returns the new buffer.
EncodeJSONObjectKeyMarker adds a JSON Object key encoding marker to buf and returns the new buffer.
EncodeJSONObjectSpanStartAscending encodes the first possible value for JSON objects, which is \x00\xff.
EncodeJSONStringKeyMarker adds a JSON String key encoding marker to buf and returns the new buffer.
EncodeJSONTrueKeyMarker adds a JSON True key encoding marker to buf and returns the new buffer.
EncodeJSONValue encodes an already-byte-encoded JSON value with no value tag but with a length prefix, appends it to the supplied buffer, and returns the final buffer.
EncodeNextBytesAscending encodes the []byte value with an extra 0x00 byte appended before encoding.
EncodeNextBytesSize returns the size of the []byte value when suffixed with a zero byte and then encoded using EncodeNextBytes{Ascending,Descending}.
EncodeNonsortingDecimal returns the resulting byte slice with the encoded decimal appended to b.
EncodeNonsortingStdlibVarint encodes an int value using encoding/binary, appends it to the supplied buffer, and returns the final buffer.
EncodeNonsortingUvarint encodes a uint64, appends it to the supplied buffer, and returns the final buffer.
EncodeNotNullAscending encodes a value that is larger than the NULL marker encoded by EncodeNull but less than any encoded value returned by EncodeVarint, EncodeFloat, EncodeBytes or EncodeString.
EncodeNotNullDescending is the descending equivalent of EncodeNotNullAscending.
EncodeNotNullValue encodes a not null value, appends it to the supplied buffer, and returns the final buffer.
EncodeNullAscending encodes a NULL value.
EncodeNullDescending is the descending equivalent of EncodeNullAscending.
EncodeNullValue encodes a null value, appends it to the supplied buffer, and returns the final buffer.
EncodeNullWithinArrayKey encodes NULL within a key encoded array.
EncodePGVectorValue encodes an already-byte-encoded PGVector value with no value tag but with a length prefix, appends it to the supplied buffer, and returns the final buffer.
EncodeStringAscending encodes the string value using an escape-based encoding.
EncodeStringDescending is the descending version of EncodeStringAscending.
EncodeTimeAscending encodes a time value, appends it to the supplied buffer, and returns the final buffer.
EncodeTimeDescending is the descending version of EncodeTimeAscending.
EncodeTimeTZAscending encodes a timetz.TimeTZ value and appends it to the supplied buffer and returns the final buffer.
EncodeTimeTZDescending is the descending version of EncodeTimeTZAscending.
EncodeTimeTZValue encodes a timetz.TimeTZ value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeTimeValue encodes a time.Time value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeTrueAscending encodes the boolean value true for use with JSON inverted indexes.
EncodeTSQueryValue encodes an already-byte-encoded TSQuery value with no value tag but with a length prefix, appends it to the supplied buffer, and returns the final buffer.
EncodeTSVectorValue encodes an already-byte-encoded TSVector value with no value tag but with a length prefix, appends it to the supplied buffer, and returns the final buffer.
EncodeUint16Ascending encodes the uint16 value using a big-endian 2 byte representation.
EncodeUint32Ascending encodes the uint32 value using a big-endian 4 byte representation.
EncodeUint32Descending encodes the uint32 value so that it sorts in reverse order, from largest to smallest.
EncodeUint64Ascending encodes the uint64 value using a big-endian 8 byte representation.
EncodeUint64Descending encodes the uint64 value so that it sorts in reverse order, from largest to smallest.
EncodeUntaggedBitArrayValue encodes a bit array value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedBox2DValue encodes a geopb.BoundingBox value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedBytesValue encodes a byte array value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedDecimalValue encodes an apd.Decimal value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedDurationValue encodes a duration.Duration value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedFloat32Value encodes a float32 value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedFloatValue encodes a float value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedGeoValue encodes a geopb.SpatialObject value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedIntValue encodes an int value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedIPAddrValue encodes a ipaddr.IPAddr value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedTimeTZValue encodes a time.Time value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedTimeValue encodes a time.Time value, appends it to the supplied buffer, and returns the final buffer.
EncodeUntaggedUUIDValue encodes a uuid.UUID value, appends it to the supplied buffer, and returns the final buffer.
EncodeUUIDValue encodes a uuid.UUID value with its value tag, appends it to the supplied buffer, and returns the final buffer.
EncodeUvarintAscending encodes the uint64 value using a variable length (length-prefixed) representation.
EncodeUvarintDescending encodes the uint64 value so that it sorts in reverse order, from largest to smallest.
EncodeValueTag encodes the prefix that is used by each of the EncodeFooValue methods.
EncodeVarintAscending encodes the int64 value using a variable length (length-prefixed) representation.
EncodeVarintDescending encodes the int64 value so that it sorts in reverse order, from largest to smallest.
EncodeVoidAscendingOrDescending encodes a void (valid for both ascending and descending order).
EncodeVoidValue encodes a void with its value tag, appends it to the supplied buffer and returns the final buffer.
GetMultiVarintLen find the length of <num> encoded varints that follow a 1-byte tag.
GetUvarintLen is similar to DecodeUvarintAscending except that it returns the length of the prefix that encodes a uint64 value in bytes without actually decoding the value.
IsArrayKeyDone returns if the first byte in the input is the array terminator for the input direction.
isJSONKeyDone returns if the first byte in the input is the JSON terminator for the input direction.
IsNextByteArrayEncodedNull returns if the first byte in the input is the NULL encoded byte within an array key.
PeekLength returns the length of the encoded value at the start of b.
PeekLengthNonsortingUvarint returns the length of the value that starts at the beginning of buf and was encoded by EncodeNonsortingUvarint.
PeekType peeks at the type of the value encoded at the start of b.
PeekValueLength returns the length of the encoded value at the start of b.
PeekValueLengthWithOffsetsAndType is the same as PeekValueLength, except it expects a dataOffset and typ value from a previous call to DecodeValueTag on its input byte slice.
PrettyPrintValue returns the string representation of all contiguous decodable values in the provided byte slice, separated by a provided separator.
PrettyPrintValueEncoded returns a string representation of the first decodable value in the provided byte slice, along with the remaining byte slice after decoding.
PrettyPrintValuesWithTypes returns a slice containing each contiguous decodable value in the provided byte slice along with a slice containing the type of each value.
PrintableBytes returns true iff the given byte array is a valid UTF-8 sequence and it is printable.
PutUint16Ascending encodes the uint16 value using a big-endian 2 byte representation at the specified index, lengthening the input slice if necessary.
PutUint32Ascending encodes the uint32 value using a big-endian 4 byte representation at the specified index, lengthening the input slice if necessary.
UndoPrefixEnd is a partial inverse for roachpb.Key.PrefixEnd.
UnsafeConvertBytesToString performs an unsafe conversion from a []byte to a string.
UnsafeConvertStringToBytes converts a string to a byte array to be used with string encoding functions.
UpperBoundNonsortingDecimalSize returns the upper bound number of bytes that the decimal will need for the non-sorting encoding.
ValidateAndConsumeArrayKeyMarker checks that the marker at the front of buf is valid for an array of the given direction, and consumes it if so.
ValidateAndConsumeJSONKeyMarker checks that the marker at the front of buf is valid/invalid for a given JSON value for the given direction.
ValidateDecodeBytesAscending is like DecodeBytesAscending, but discards the decoded bytes.
WordLen returns the size in bytes of the given array of Words.

# Constants

Type values.
Array key encoding.
Array key encoded descendingly.
Direction values.
Type values.
BitArray encoded descendingly.
Type values.
Type values.
Bytes encoded descendingly.
Type values.
Direction values.
Type values.
3 varints are encoded.
EncodedTimeTZMaxLen is the largest number of bytes used when encoding a TimeTZ.
Type values.
Type values.
Type values.
Type values.
Type values.
253.
128.
Type values.
Type values.
Type values.
Type values.
Special case.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
MaxGeoInvertedBBoxLen is the maximum length of the encoded bounding box for geo inverted keys.
MaxNonsortingUvarintLen is the maximum length of an EncodeNonsortingUvarint encoded value.
MaxNonsortingVarintLen is the maximum length of an EncodeNonsortingVarint encoded value.
MaxVarintLen is the maximum length of a value encoded using any of: - EncodeVarintAscending - EncodeVarintDescending - EncodeUvarintAscending - EncodeUvarintDescending.
NoColumnID is a sentinel for the EncodeFooValue methods representing an invalid column id.
Type values.
Type values.
Type values.
SentinelType is used for bit manipulation to check if the encoded type value requires more than 4 bits, and thus will be encoded in two bytes.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.
Type values.

# Type aliases

Direction for ordering results.
Type represents the type of a value encoded by Encode{Null,NotNull,Varint,Uvarint,Float,Bytes}.