Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-json-experiment/json
/ functions
Functions
1,017 in github.com/go-json-experiment/json
⨍
Functions
1,017
◇
Types & classes
442
↓ 12 callers
Method
MayAppendDelim
MayAppendDelim appends a colon or comma that may precede the next token.
jsontext/state.go:389
↓ 12 callers
Method
NeedFlush
NeedFlush determines whether to flush at this point.
jsontext/encode.go:147
↓ 12 callers
Function
lookupArshaler
map[reflect.Type]*arshaler
arshal.go:535
↓ 12 callers
Function
mayAppendSupportFormatTag
(opts []Options)
options_format_global.go:24
↓ 12 callers
Function
wrapErrUnsupported
(err error, what string)
errors.go:315
↓ 11 callers
Function
AppendFloat
AppendFloat appends src to dst as a JSON number per RFC 7159, section 6. It formats numbers similar to the ES6 number-to-string conversion. See https:
internal/jsonwire/encode.go:213
↓ 11 callers
Method
Clear
Clear clears both the presence and value for the provided bool or bools. The value bit of f (i.e., the LSB) is ignored.
internal/jsonflags/flags.go:216
↓ 11 callers
Method
Clone
Clone returns a copy of v.
jsontext/value.go:69
↓ 11 callers
Function
Int
Int constructs a Token representing a JSON number from an int64.
jsontext/alias.go:507
↓ 11 callers
Function
JoinUnmarshalers
JoinUnmarshalers constructs a flattened list of unmarshal functions. If multiple functions in the list are applicable for a value of a given type, the
alias.go:575
↓ 11 callers
Method
Options
()
errors.go:103
↓ 11 callers
Function
SpaceAfterComma
SpaceAfterComma specifies that the JSON output should emit a space character after each comma separator following a JSON object value or array element
jsontext/alias.go:341
↓ 11 callers
Method
Token
Token returns the next JSON token in the input stream. At the end of the input stream, Token returns nil, [io.EOF]. Token guarantees that the delimit
v1/stream.go:220
↓ 11 callers
Method
isValidNamespace
isValidNamespace reports whether the JSON object namespace is valid.
jsontext/state.go:528
↓ 11 callers
Function
newUnmarshalErrorAfterWithValue
newUnmarshalErrorAfterWithValue wraps err in a SemanticError assuming that d is positioned right after the previous token or value, which caused an er
errors.go:184
↓ 11 callers
Function
transformSyntacticError
(err error)
v1/scanner.go:56
↓ 10 callers
Function
ConsumeSimpleString
ConsumeSimpleString consumes the next JSON string per RFC 7159, section 7 but is limited to the grammar for an ASCII string without escape sequences.
internal/jsonwire/decode.go:97
↓ 10 callers
Method
Contains
Contains reports whether the JSON value that p points to is equal to or contains the JSON value that pc points to.
jsontext/state.go:113
↓ 10 callers
Method
DepthLength
DepthLength reports the current nested depth and the length of the last JSON object or array.
jsontext/state.go:264
↓ 10 callers
Function
Float32
Float32 constructs a Token representing a JSON number as a 32-bit floating-point number formatted according to ECMA-262, 10th edition, section 7.1.12.
jsontext/token.go:162
↓ 10 callers
Method
Indent
Indent reformats the whitespace in the raw JSON value so that each element in a JSON object or array begins on an indented line according to the nesti
jsontext/value.go:187
↓ 10 callers
Method
Parent
Parent strips off the last token and returns the remaining pointer. The parent of an empty p is an empty string.
jsontext/state.go:121
↓ 10 callers
Function
ParseUint
ParseUint parses b as a decimal unsigned integer according to a strict subset of the JSON number grammar, returning the value if valid. It returns (0,
internal/jsonwire/decode.go:593
↓ 10 callers
Method
String
()
arshal_test.go:734
↓ 10 callers
Method
appendLiteral
appendLiteral appends a JSON literal as the next token in the sequence. If an error is returned, the state is not mutated.
jsontext/state.go:270
↓ 10 callers
Function
newNonStringNameError
(offset int64, pointer jsontext.Pointer)
arshal_test.go:35
↓ 10 callers
Method
round
round updates a value.
internal/zstd/xxhash.go:135
↓ 10 callers
Function
runTestOrBench
(tb testing.TB, name string, numBytes int64, run func(tb testing.TB))
bench_test.go:633
↓ 9 callers
Function
NewEncoder
NewEncoder returns a new encoder that writes to w.
v1/alias.go:850
↓ 9 callers
Method
StackPointer
()
errors.go:102
↓ 9 callers
Function
WithIndent
WithIndent specifies that the encoder should emit multiline output where each element in a JSON object or array begins on a new, indented line beginni
jsontext/alias.go:373
↓ 9 callers
Function
diff
(t *testing.T, a, b []byte)
v1/scanner_test.go:212
↓ 9 callers
Method
isObject
isObject reports whether this is a JSON object.
jsontext/state.go:463
↓ 9 callers
Function
isSyntacticError
(err error)
errors.go:53
↓ 9 callers
Method
unmarshal
(b []byte)
arshal_time.go:394
↓ 9 callers
Method
wrapNonEOFError
(off int, err error)
internal/zstd/zstd.go:489
↓ 8 callers
Method
AppendRaw
AppendRaw appends either a raw string (without double quotes) or number. Specify safeASCII if the string output is guaranteed to be ASCII without any
jsontext/encode.go:443
↓ 8 callers
Method
Bool
Bool returns the value for a JSON boolean. It panics if the token kind is not a JSON boolean.
jsontext/token.go:244
↓ 8 callers
Function
ConsumeLiteral
ConsumeLiteral consumes the next JSON literal per RFC 7159, section 3. If the input appears truncated, it returns io.ErrUnexpectedEOF.
internal/jsonwire/decode.go:76
↓ 8 callers
Function
QuoteRune
QuoteRune quotes the first rune in the input.
internal/jsonwire/wire.go:62
↓ 8 callers
Function
implements
implements is like t.Implements(ifaceType) but checks whether either t or reflect.PointerTo(t) implements the interface. It also reports whether the v
arshal_methods.go:369
↓ 8 callers
Method
insertQuoted
insertQuoted inserts a name and reports whether it was inserted, which only occurs if name is not already in the namespace. The provided name must be
jsontext/state.go:762
↓ 8 callers
Method
isActiveNamespace
isActiveNamespace reports whether the JSON object namespace is actively being updated and used for duplicate name checks.
jsontext/state.go:518
↓ 8 callers
Function
isFatalError
isFatalError reports whether this error must terminate arshaling. All errors are considered fatal unless operating under [jsonflags.ReportErrorsWithLe
errors.go:62
↓ 8 callers
Method
isNumeric
()
arshal_time.go:360
↓ 8 callers
Method
needDelim
needDelim reports whether a colon or comma token should be implicitly emitted before the next token of the specified kind. A zero value means no delim
jsontext/state.go:403
↓ 8 callers
Method
previousBuffer
()
jsontext/decode.go:283
↓ 8 callers
Method
previousOffsetStart
()
jsontext/decode.go:281
↓ 8 callers
Method
wrapError
(off int, err error)
internal/zstd/zstd.go:500
↓ 7 callers
Function
AppendUnquote
AppendUnquote appends the unescaped form of a JSON string in src to dst. Any invalid UTF-8 within the string will be replaced with utf8.RuneError, but
internal/jsonwire/decode.go:257
↓ 7 callers
Function
ConsumeNumber
ConsumeNumber consumes the next JSON number per RFC 7159, section 6. It reports the number of bytes consumed and whether an error was encountered. If
internal/jsonwire/decode.go:465
↓ 7 callers
Function
DefaultOptionsV2
DefaultOptionsV2 is the full set of all options that define v2 semantics. It is equivalent to the set of options in [encoding/json.DefaultOptionsV1] a
alias.go:826
↓ 7 callers
Method
Error
()
errors.go:335
↓ 7 callers
Method
Error
()
jsontext/errors.go:26
↓ 7 callers
Method
Float
Float returns the floating-point value for a JSON number parsed according to 64 bits of precision. If the JSON number is outside the representable ra
jsontext/token.go:386
↓ 7 callers
Method
Kind
Kind returns the token kind.
jsontext/token.go:603
↓ 7 callers
Function
SpaceAfterColon
SpaceAfterColon specifies that the JSON output should emit a space character after each colon separator following a JSON object name. If false, then n
jsontext/alias.go:332
↓ 7 callers
Method
UnreadBuffer
UnreadBuffer returns the data remaining in the unread buffer, which may contain zero or more bytes. This is the data already consumed from the input [
jsontext/decode.go:1154
↓ 7 callers
Function
codeInit
()
v1/bench_test.go:44
↓ 7 callers
Method
format
format accepts two []Options to avoid the allocation of appending them together. It is equivalent to v.Format(append(opts1, opts2...)...).
jsontext/value.go:137
↓ 7 callers
Method
isArray
isArray reports whether this is a JSON array.
jsontext/state.go:468
↓ 7 callers
Method
makeReverseBitReader
makeReverseBitReader makes a reverseBitReader reading backward from off to start. The bitstream starts with a 1 bit in the last byte, at off.
internal/zstd/bits.go:83
↓ 6 callers
Method
AppendIndent
AppendIndent appends the appropriate number of indentation characters for the current nested level, n.
jsontext/encode.go:653
↓ 6 callers
Method
AppendStackPointer
(b []byte, where int)
jsontext/encode.go:990
↓ 6 callers
Method
DisableNamespace
DisableNamespace disables the JSON object namespace such that the Encoder or Decoder no longer updates the namespace.
jsontext/state.go:512
↓ 6 callers
Function
Indent
Indent appends to dst an indented form of the JSON-encoded src. Each element in a JSON object or array begins on a new, indented line beginning with p
v1/alias.go:517
↓ 6 callers
Function
PreserveRawStrings
PreserveRawStrings specifies that when encoding a raw JSON string in a [Token] or [Value], pre-escaped sequences in a JSON string are preserved to the
jsontext/alias.go:280
↓ 6 callers
Method
PreviousTokenOrValue
PreviousTokenOrValue returns the previously read token or value unless it has been invalidated by a call to PeekKind. If a token is just a delimiter,
jsontext/decode.go:290
↓ 6 callers
Method
ReplaceLastQuotedOffset
ReplaceLastQuotedOffset replaces the last name with the starting offset to the quoted name in some remote buffer. All offsets provided must be relativ
jsontext/state.go:593
↓ 6 callers
Method
SkipValue
SkipValue is semantically equivalent to calling [Decoder.ReadValue] and discarding the result except that memory is not wasted trying to hold the enti
jsontext/decode.go:413
↓ 6 callers
Function
UnmarshalDecode
UnmarshalDecode deserializes a Go value from a [jsontext.Decoder] according to the provided unmarshal or decode options (while ignoring marshal or enc
alias.go:528
↓ 6 callers
Function
WithIndentPrefix
WithIndentPrefix specifies that the encoder should emit multiline output where each element in a JSON object or array begins on a new, indented line b
jsontext/alias.go:385
↓ 6 callers
Function
addr
(v T)
v1/diff_test.go:250
↓ 6 callers
Method
appendNumber
appendNumber appends a JSON number to dst and returns it. It panics if t is not a JSON number.
jsontext/token.go:324
↓ 6 callers
Method
appendString
appendString appends a JSON string to dst and returns it. It panics if t is not a JSON string.
jsontext/token.go:257
↓ 6 callers
Function
implementsAny
implementsAny is like t.Implements(ifaceType) for a list of interfaces, but checks whether either t or reflect.PointerTo(t) implements the interface.
arshal_methods.go:356
↓ 6 callers
Method
length
length reports the number of names in the namespace.
jsontext/state.go:741
↓ 6 callers
Function
makeFlags
(f ...jsonflags.Bools)
internal/jsonopts/options_test.go:19
↓ 6 callers
Function
newUnmarshalErrorAfterWithSkipping
newUnmarshalErrorAfterWithSkipping is like [newUnmarshalErrorAfter], but automatically skips the remainder of the current value if [jsonflags.ReportEr
errors.go:195
↓ 6 callers
Method
pop
pop ascends out of a nested JSON object.
jsontext/state.go:622
↓ 6 callers
Method
push
push descends into a nested JSON object.
jsontext/state.go:586
↓ 5 callers
Function
Bool
Bool constructs a Token representing a JSON boolean.
jsontext/alias.go:485
↓ 5 callers
Function
Compact
Compact appends to dst the JSON-encoded src with insignificant space characters elided.
v1/alias.go:502
↓ 5 callers
Method
InputOffset
InputOffset returns the current input byte offset. It gives the location of the next byte immediately after the most recently returned token or value.
jsontext/decode.go:1135
↓ 5 callers
Method
Int
Int returns the signed integer value for a JSON number. It reports an error that matches [strconv.ErrSyntax] according to [errors.Is] if the JSON num
jsontext/token.go:452
↓ 5 callers
Method
IsZero
()
v1/encode_test.go:93
↓ 5 callers
Method
Join
(srcs ...Options)
internal/jsonopts/options.go:127
↓ 5 callers
Method
LastToken
LastToken returns the last token in the pointer. The last token of an empty p is an empty string.
jsontext/state.go:127
↓ 5 callers
Function
MarshalEncode
MarshalEncode serializes a Go value into an [jsontext.Encoder] according to the provided marshal or encode options (while ignoring unmarshal or decode
alias.go:368
↓ 5 callers
Function
MarshalIndent
MarshalIndent is like [Marshal] but applies [Indent] to format the output. Each JSON element in the output will begin on a new line beginning with pre
v1/alias.go:463
↓ 5 callers
Function
MatchCaseInsensitiveNames
MatchCaseInsensitiveNames specifies that JSON object members are matched against Go struct fields using a case-insensitive match of the name. If a nam
alias.go:915
↓ 5 callers
Method
OutputOffset
OutputOffset returns the current output byte offset. It gives the location of the next byte immediately after the most recently written token or value
jsontext/encode.go:900
↓ 5 callers
Method
String
String returns the literal text of the number.
v1/decode.go:197
↓ 5 callers
Function
TrimSuffixWhitespace
TrimSuffixWhitespace trims JSON whitespace from the end of b.
internal/jsonwire/wire.go:21
↓ 5 callers
Method
Uint
Uint returns the unsigned integer value for a JSON number. It reports an error that matches [strconv.ErrSyntax] if the JSON number does not match the
jsontext/token.go:535
↓ 5 callers
Method
Unwrap
()
errors.go:443
↓ 5 callers
Function
appendFracBase10
appendFracBase10 appends the fraction of n/max10, where max10 is a power-of-10 that is larger than n.
arshal_time.go:708
↓ 5 callers
Method
copyQuotedBuffer
copyQuotedBuffer copies names from the remote buffer into the local names buffer so that there are no more offset references into the remote buffer. T
jsontext/state.go:630
↓ 5 callers
Method
fetch
fetch is called to ensure that at least b bits are available. It reports false if this can't be done, in which case only rbr.cnt bits are available.
internal/zstd/bits.go:113
↓ 5 callers
Method
fetch
fetch reads at least 1 byte from the underlying io.Reader. It returns io.ErrUnexpectedEOF if zero bytes were read and io.EOF was seen.
jsontext/decode.go:175
← previous
next →
101–200 of 1,017, ranked by callers