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
↓ 1,563 callers
Function
Name
Name annotates a case name with the file and line of the caller.
internal/jsontest/testcase.go:24
↓ 904 callers
Function
addr
(v T)
arshal_test.go:737
↓ 335 callers
Method
withPos
(prefix string, pointer Pointer)
jsontext/coder_test.go:36
↓ 282 callers
Method
withType
(k jsontext.Kind, t reflect.Type)
arshal_test.go:70
↓ 277 callers
Method
Get
Get reports whether the bool (or any of the bools) is true. This is generally only used with a singular bool. The value bit of f (i.e., the LSB) is ig
internal/jsonflags/flags.go:204
↓ 242 callers
Function
E
(err error)
jsontext/coder_test.go:24
↓ 210 callers
Function
String
String constructs a Token representing a JSON string. The provided string should contain valid UTF-8, otherwise invalid characters may be mangled as t
jsontext/alias.go:492
↓ 142 callers
Method
withPos
(prefix string, pointer jsontext.Pointer)
arshal_test.go:64
↓ 137 callers
Function
EU
(err error)
arshal_test.go:55
↓ 99 callers
Function
newInvalidCharacterError
(prefix, where string)
jsontext/coder_test.go:28
↓ 96 callers
Function
EM
(err error)
arshal_test.go:51
↓ 91 callers
Function
ExperimentalSupportFormatTag
ExperimentalSupportFormatTag enables support for the `format` tag. WARNING: This is an experimental feature and will be removed in the future as eith
internal/jsonopts/options_format.go:118
↓ 90 callers
Method
Kind
()
jsontext/coder_test.go:52
↓ 82 callers
Function
T
()
arshal_test.go:82
↓ 77 callers
Function
WithMarshalers
WithMarshalers specifies a list of type-specific marshalers to use, which can be used to override the default marshal behavior for values of particula
alias.go:932
↓ 75 callers
Function
len64
(in Bytes)
bench_test.go:126
↓ 74 callers
Method
Set
Set sets both the presence and value for the provided bool (or set of bools).
internal/jsonflags/flags.go:188
↓ 74 callers
Function
len64
(s string)
v1/decode_test.go:28
↓ 66 callers
Method
String
()
v1/stream.go:205
↓ 64 callers
Method
WriteToken
WriteToken writes the next token and advances the internal write offset. The provided token kind must be consistent with the JSON grammar. For exampl
jsontext/encode.go:344
↓ 63 callers
Method
Has
Has reports whether the bool (or any of the bools) is set. The value bit of f (i.e., the LSB) is ignored.
internal/jsonflags/flags.go:210
↓ 63 callers
Function
Marshal
Marshal returns the JSON encoding of v. Marshal traverses the value v recursively. The input value is encoded as JSON according the following rules:
v1/alias.go:456
↓ 59 callers
Method
ReadToken
ReadToken reads the next [Token], advancing the read offset. The returned token is only valid until the next Peek, Read, or Skip call. It returns [io.
jsontext/decode.go:468
↓ 59 callers
Function
WithUnmarshalers
WithUnmarshalers specifies a list of type-specific unmarshalers to use, which can be used to override the default unmarshal behavior for values of par
alias.go:941
↓ 56 callers
Function
rawToken
(s string)
jsontext/token.go:128
↓ 53 callers
Function
AllowDuplicateNames
AllowDuplicateNames specifies that JSON objects may contain duplicate member names. Disabling the duplicate name check may provide performance benefit
jsontext/alias.go:239
↓ 53 callers
Method
ReadValue
ReadValue returns the next raw JSON value, advancing the read offset. The value is stripped of any leading or trailing whitespace and contains the exa
jsontext/decode.go:676
↓ 52 callers
Function
MarshalToFunc
MarshalToFunc constructs a type-specific marshaler that specifies how to marshal values of type T. T can be any type except a named pointer. The funct
alias.go:606
↓ 52 callers
Function
NewInvalidCharacterError
(prefix Bytes, where string)
internal/jsonwire/wire.go:129
↓ 48 callers
Method
makeError
(off int, msg string)
internal/zstd/zstd.go:496
↓ 47 callers
Function
MarshalFunc
MarshalFunc constructs a type-specific marshaler that specifies how to marshal values of type T. T can be any type except a named pointer. The functio
alias.go:590
↓ 47 callers
Function
mustParseTime
(layout, value string)
arshal_test.go:741
↓ 46 callers
Method
Join
Join joins two sets of flags such that the latter takes precedence.
internal/jsonflags/flags.go:176
↓ 45 callers
Function
Unmarshal
Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. If v is nil or not a pointer, Unmarshal returns an [Invalid
v1/alias.go:274
↓ 45 callers
Method
WriteValue
WriteValue writes the next raw value and advances the internal write offset. The Encoder does not simply copy the provided value verbatim, but parses
jsontext/encode.go:524
↓ 44 callers
Function
AllowInvalidUTF8
AllowInvalidUTF8 specifies that JSON strings may contain invalid UTF-8, which will be mangled as the Unicode replacement character, U+FFFD. This cause
jsontext/alias.go:249
↓ 43 callers
Method
Decoder
Decoder returns a pointer to the underlying decoderState.
jsontext/export.go:58
↓ 43 callers
Function
newMarshalErrorBefore
newMarshalErrorBefore wraps err in a SemanticError assuming that e is positioned right before the next token or value, which causes an error.
errors.go:126
↓ 39 callers
Method
Decode
Decode reads the next JSON-encoded value from its input and stores it in the value pointed to by v. See the documentation for [Unmarshal] for details
v1/stream.go:74
↓ 39 callers
Function
Multiline
Multiline specifies that the JSON output should expand to multiple lines, where every JSON object member or JSON array element appears on a new, inden
jsontext/alias.go:358
↓ 39 callers
Function
UnmarshalFromFunc
UnmarshalFromFunc constructs a type-specific unmarshaler that specifies how to unmarshal values of type T. T must be an unnamed pointer or an interfac
alias.go:634
↓ 39 callers
Function
addr
(v T)
v1/decode_test.go:2062
↓ 39 callers
Method
withVal
(val string)
arshal_test.go:59
↓ 37 callers
Function
StringifyNumbers
StringifyNumbers specifies that types that would normally be encoded as a JSON number to instead be encoded as a JSON string containing the equivalent
alias.go:850
↓ 37 callers
Function
wrapSyntacticError
wrapSyntacticError wraps an error and annotates it with a precise location using the provided [encoderState] or [decoderState]. If err is an [ioError]
jsontext/errors.go:74
↓ 36 callers
Function
newDuplicateNameError
(ptr jsontext.Pointer, quotedName []byte, offset int64)
errors.go:447
↓ 34 callers
Method
String
String prints the kind in a humanly readable fashion.
jsontext/token.go:643
↓ 33 callers
Method
NeedObjectName
NeedObjectName reports whether the next token must be a JSON string, which is necessary for JSON object names.
jsontext/state.go:474
↓ 33 callers
Function
Uint
Uint constructs a Token representing a JSON number from a uint64.
jsontext/alias.go:512
↓ 32 callers
Method
Encoder
Encoder returns a pointer to the underlying encoderState.
jsontext/export.go:55
↓ 31 callers
Method
PeekKind
PeekKind retrieves the next token kind, but does not advance the read offset. It returns [KindInvalid] if an error occurs. Any such error is cached u
jsontext/decode.go:314
↓ 31 callers
Function
UnmarshalFunc
UnmarshalFunc constructs a type-specific unmarshaler that specifies how to unmarshal values of type T. T must be an unnamed pointer or an interface ty
alias.go:619
↓ 30 callers
Method
Depth
Depth is the current nested depth of JSON objects and arrays. It is one-indexed (i.e., top-level values have a depth of 1).
jsontext/state.go:249
↓ 30 callers
Function
Unmarshal
Unmarshal decodes a []byte input into a Go value according to the provided unmarshal and decode options (while ignoring marshal or encode options). Th
alias.go:502
↓ 30 callers
Function
addr
(v T)
bench_test.go:122
↓ 28 callers
Function
ConsumeWhitespace
ConsumeWhitespace consumes leading JSON whitespace per RFC 7159, section 2.
internal/jsonwire/decode.go:33
↓ 28 callers
Function
NewDecoder
NewDecoder constructs a new streaming decoder reading from r. If r is a [bytes.Buffer], then the decoder parses directly from the buffer without firs
jsontext/alias.go:150
↓ 28 callers
Function
newUnmarshalErrorAfter
newUnmarshalErrorAfter wraps err in a SemanticError assuming that d is positioned right after the previous token or value, which caused an error.
errors.go:164
↓ 26 callers
Function
newInvalidFormatError
newInvalidFormatError constructs a SemanticError because the current type t cannot handle the provided options format. This function must be called be
errors.go:113
↓ 25 callers
Function
GetOption
GetOption returns the value stored in opts with the provided setter, reporting whether the value is present. If not present, the returned value is the
alias.go:819
↓ 25 callers
Method
Length
Length reports the number of elements in the JSON object or array. Each name and value in an object entry is treated as a separate element.
jsontext/state.go:458
↓ 25 callers
Method
reset
()
jsontext/state.go:76
↓ 24 callers
Function
Float
Float constructs a Token representing a JSON number as a 64-bit floating-point number formatted according to ECMA-262, 10th edition, section 7.1.12.1
jsontext/alias.go:502
↓ 22 callers
Method
Error
()
v1/scanner.go:52
↓ 22 callers
Function
Marshal
Marshal serializes a Go value as a []byte according to the provided marshal and encode options (while ignoring unmarshal or decode options). It does n
alias.go:348
↓ 22 callers
Function
NewInvalidEscapeSequenceError
(what Bytes)
internal/jsonwire/wire.go:134
↓ 19 callers
Method
IsValid
IsValid reports whether the raw JSON value is syntactically valid according to the specified options. By default (if no options are specified), it va
jsontext/value.go:96
↓ 19 callers
Function
NewDecoder
NewDecoder returns a new decoder that reads from r. The decoder introduces its own buffering and may read data from r beyond the JSON values requeste
v1/alias.go:842
↓ 19 callers
Function
indentNewlines
(s string)
v1/scanner_test.go:18
↓ 19 callers
Method
lookup
(fnc func(*Coder, addressableValue, *jsonopts.Struct) error, t reflect.Type)
arshal_funcs.go:114
↓ 19 callers
Method
makeEOFError
(off int)
internal/zstd/zstd.go:485
↓ 18 callers
Method
needMore
needMore reports whether there are no more unread bytes.
jsontext/decode.go:275
↓ 17 callers
Method
InputOffset
InputOffset returns the input stream byte offset of the current decoder position. The offset gives the location of the end of the most recently return
v1/stream.go:290
↓ 17 callers
Method
Reset
Reset resets an encoder such that it is writing afresh to w and configured with the provided options. Reset must not be called on an Encoder passed to
jsontext/encode.go:101
↓ 17 callers
Function
UnquoteMayCopy
UnquoteMayCopy returns the unescaped form of b. If there are no escaped characters, the output is simply a subslice of the input with the surrounding
internal/jsonwire/decode.go:413
↓ 16 callers
Function
Deterministic
Deterministic specifies that the same input value will be serialized as the exact same output bytes. Different processes of the same program will seri
alias.go:861
↓ 16 callers
Method
Write
(b []byte)
jsontext/coder_test.go:823
↓ 16 callers
Method
consumeWhitespace
consumeWhitespace consumes all whitespace starting at d.buf[pos:]. It returns the new position in d.buf immediately after the last whitespace. If it r
jsontext/decode.go:838
↓ 16 callers
Function
newAddressableValue
newAddressableValue constructs a new addressable value of type t.
arshal.go:510
↓ 15 callers
Method
Compare
(y objectMember)
jsontext/value.go:277
↓ 15 callers
Method
Encode
Encode writes the JSON encoding of v to the stream, followed by a newline character. See the documentation for [Marshal] for details about the conver
v1/stream.go:136
↓ 15 callers
Method
IsVerbatim
()
internal/jsonwire/decode.go:29
↓ 15 callers
Function
equalError
(x, y error)
jsontext/coder_test.go:42
↓ 15 callers
Method
val
val is called to fetch a value of b bits.
internal/zstd/bits.go:50
↓ 15 callers
Function
wrapWithObjectName
wrapWithObjectName wraps err with a JSON object name access, which must be a valid quoted JSON string.
jsontext/errors.go:183
↓ 14 callers
Method
Increment
Increment increments the number of elements for the current object or array. This assumes that overflow won't practically be an issue since 1<<bits.On
jsontext/state.go:500
↓ 14 callers
Function
JoinMarshalers
JoinMarshalers constructs a flattened list of marshal functions. If multiple functions in the list are applicable for a value of a given type, then th
alias.go:552
↓ 14 callers
Method
String
String returns the unescaped string value for a JSON string. For other JSON kinds, this returns the raw JSON representation.
jsontext/token.go:278
↓ 14 callers
Function
baseLabel
(base uint64)
arshal_time_test.go:20
↓ 14 callers
Function
newUnmarshalErrorBeforeWithSkipping
newUnmarshalErrorBeforeWithSkipping is like [newUnmarshalErrorBefore], but automatically skips the next value if [jsonflags.ReportErrorsWithLegacySema
errors.go:152
↓ 14 callers
Method
normalize
normalize coalesces all possible starting characters of a number as just '0', and converts all invalid kinds to 0.
jsontext/token.go:694
↓ 14 callers
Function
stripWhitespace
(s string)
v1/scanner_test.go:22
↓ 13 callers
Method
AvailableBuffer
AvailableBuffer returns a zero-length buffer with a possible non-zero capacity. This buffer is intended to be used to populate a [Value] being passed
jsontext/encode.go:919
↓ 13 callers
Method
Join
(f2 ValueFlags)
internal/jsonwire/decode.go:28
↓ 13 callers
Function
NewEncoder
NewEncoder constructs a new streaming encoder writing to w configured with the provided options. It flushes the internal buffer when the buffer is suf
jsontext/alias.go:192
↓ 13 callers
Function
newInvalidCharacterError
(prefix, where string, offset int64, pointer jsontext.Pointer)
arshal_test.go:39
↓ 12 callers
Function
AppendQuote
AppendQuote appends src to dst as a JSON string per RFC 7159, section 7. It takes in flags and respects the following: - EscapeForHTML escapes '<', '
internal/jsonwire/encode.go:65
↓ 12 callers
Method
Flush
Flush flushes the buffer to the underlying io.Writer. It may append a trailing newline after the top-level value.
jsontext/encode.go:159
↓ 12 callers
Method
IsIOError
(err error)
jsontext/export.go:88
↓ 12 callers
Method
Last
Last returns a pointer to the last JSON object namespace.
jsontext/state.go:699
next →
1–100 of 1,017, ranked by callers