Decoder is a token-based JSON decoder. Clone returns a copy of the Decoder for use in reading ahead the next JSON
object, array or other values without affecting current Decoder. Peek looks ahead and returns the next token kind without advancing a read. Position returns line and column number of given index of the original input.
It will panic if index is out of range. Read returns the next JSON token.
It will return an error if there is no valid token.
func NewDecoder(b []byte) *Decoder
func (*Decoder).Clone() *Decoder
Encoder provides methods to write out JSON constructs and values. The user is
responsible for producing valid sequences of JSON constructs and values. Bytes returns the content of the written bytes. EndArray writes out the ']' symbol. EndObject writes out the '}' symbol. StartArray writes out the '[' symbol. StartObject writes out the '{' symbol. WriteBool writes out the given boolean value. WriteFloat writes out the given float and bitSize in JSON number value. WriteInt writes out the given signed integer in JSON number value. WriteName writes out the given string in JSON string value and the name
separator ':'. Returns error if input string contains invalid UTF-8, which
should not be likely as protobuf field names should be valid. WriteNull writes out the null value. WriteString writes out the given string in JSON string value. Returns error
if input string contains invalid UTF-8. WriteUint writes out the given unsigned integer in JSON number value.
*Encoder : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice
func NewEncoder(buf []byte, indent string) (*Encoder, error)
Token provides a parsed token kind and value.
Values are provided by the difference accessor methods. The accessor methods
Name, Bool, and ParsedString will panic if called on the wrong kind. There
are different accessor methods for the Number kind for converting to the
appropriate Go numeric type and those methods have the ok return value. Bool returns the bool value if token kind is Bool, else it panics. Float returns the floating-point number if token kind is Number.
The floating-point precision is specified by the bitSize parameter: 32 for
float32 or 64 for float64. If bitSize=32, the result still has type float64,
but it will be convertible to float32 without changing its value. It will
return false if the number exceeds the floating point limits for given
bitSize. Int returns the signed integer number if token is Number.
The given bitSize specifies the integer type that the result must fit into.
It returns false if the number is not an integer value or if the result
exceeds the limits for given bitSize. Kind returns the token kind. Name returns the object name if token is Name, else it panics. ParsedString returns the string value for a JSON string token or the read
value in string if token is not a string. Pos returns the token position from the input. RawString returns the read value in string. Uint returns the signed integer number if token is Number.
The given bitSize specifies the unsigned integer type that the result must
fit into. It returns false if the number is not an unsigned integer value
or if the result exceeds the limits for given bitSize.
Token : github.com/polarsignals/frostdb/query/logicalplan.Named
func (*Decoder).Peek() (Token, error)
func (*Decoder).Read() (Token, error)
func TokenEquals(x, y Token) bool
Package-Level Functions (total 3)
NewDecoder returns a Decoder to read the given []byte.
NewEncoder returns an Encoder.
If indent is a non-empty string, it causes every entry for an Array or Object
to be preceded by the indent and trailed by a newline.
TokenEquals returns true if given Tokens are equal, else false.
Package-Level Variables (only one)
ErrUnexpectedEOF means that EOF was encountered in the middle of the input.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.