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
Method
Error
()
internal/jsonwire/wire.go:147
Method
Error
()
internal/zstd/zstd.go:477
Method
Error
()
v1/encode.go:213
Method
Error
()
v1/encode.go:224
Method
Error
()
v1/encode.go:238
Method
Error
()
v1/encode.go:250
Method
Error
()
v1/decode.go:172
Method
Error
()
v1/decode.go:182
Method
Error
()
jsontext/errors.go:39
Method
Error
()
jsontext/errors.go:120
Function
EscapeForHTML
EscapeForHTML specifies that '<', '>', and '&' characters within JSON strings should be escaped as a hexadecimal Unicode codepoint (e.g., \u003c) so t
jsontext/options.go:81
Function
EscapeForJS
EscapeForJS specifies that U+2028 and U+2029 characters within JSON strings should be escaped as a hexadecimal Unicode codepoint (e.g., \u2028) so tha
jsontext/options.go:94
Function
ExampleDecoder
This example uses a Decoder to decode a stream of distinct JSON values.
v1/example_test.go:60
Function
ExampleDecoder_Decode_stream
This example uses a Decoder to decode a streaming array of JSON objects.
v1/example_test.go:127
Function
ExampleDecoder_Token
This example uses a Decoder to decode a stream of distinct JSON values.
v1/example_test.go:90
Function
ExampleEscapeForHTML
Directly embedding JSON within HTML requires special handling for safety. Escape certain runes to prevent JSON directly treated as HTML from being abl
jsontext/example_test.go:105
Function
ExampleHTMLEscape
()
v1/example_test.go:307
Function
ExampleIndent
()
v1/example_test.go:248
Function
ExampleMarshal
()
v1/example_test.go:20
Function
ExampleMarshalIndent
()
v1/example_test.go:279
Function
ExampleRawMessage_marshal
This example uses RawMessage to use a precomputed JSON during marshal.
v1/example_test.go:225
Function
ExampleRawMessage_unmarshal
This example uses RawMessage to delay parsing part of a JSON message.
v1/example_test.go:179
Function
ExampleUnmarshal
()
v1/example_test.go:40
Function
ExampleValid
()
v1/example_test.go:298
Function
ExampleWithMarshalers_errors
Many error types are not serializable since they tend to be Go structs without any exported fields (e.g., errors constructed with [errors.New]). Some
example_test.go:416
Function
ExampleWithUnmarshalers_rawNumber
In some applications, the exact precision of JSON numbers needs to be preserved when unmarshaling. This can be accomplished using a type-specific unma
example_test.go:467
Function
ExampleWithUnmarshalers_recordOffsets
When using JSON for parsing configuration files, the parsing logic often needs to report an error with a line and column indicating where in the input
example_test.go:503
Function
Example_caseSensitivity
Unmarshal matches JSON object names with Go struct fields using a case-sensitive match, but can be configured to use a case-insensitive match with the
example_test.go:102
Function
Example_customMarshalJSON
()
v1/example_marshaling_test.go:56
Function
Example_embeddedFields
JSON objects can be embedded within a parent object similar to how Go structs can be embedded within a parent struct. The JSON embedding rules are sim
example_test.go:276
Function
Example_fieldNames
By default, JSON object names for Go struct fields are derived from the Go field name, but may be specified in the `json` tag. Due to JSON's heritage
example_test.go:69
Function
Example_omitFields
Go struct fields can be omitted from the output depending on either the input Go value or the output JSON encoding of the value. The "omitzero" option
example_test.go:148
Function
Example_orderedObject
The exact order of JSON object can be preserved through the use of a specialized type that implements [MarshalerTo] and [UnmarshalerFrom].
example_orderedobject_test.go:81
Function
Example_protoJSON
Some Go types have a custom JSON representation where the implementation is delegated to some external package. Consequently, the "json" package will
example_test.go:368
Function
Example_serveHTTP
When implementing HTTP endpoints, it is common to be operating with an [io.Reader] and an [io.Writer]. The [MarshalWrite] and [UnmarshalRead] function
example_test.go:333
Function
Example_stringReplace
This example demonstrates the use of the [Encoder] and [Decoder] to parse and modify JSON without unmarshaling it into a concrete Go type.
jsontext/example_test.go:22
Function
Example_textMarshal
If a type implements [encoding.TextMarshaler] and/or [encoding.TextUnmarshaler], then the MarshalText and UnmarshalText methods are used to encode/dec
example_test.go:30
Function
Example_textMarshalJSON
()
v1/example_text_marshaling_test.go:50
Method
ExperimentalSupportFormatTag
ExperimentalSupportFormatTag is a marker method that is specially recognized by the "encoding/json/v2" runtime.
options_format.go:26
Method
ExperimentalSupportFormatTag
ExperimentalSupportFormatTag is a marker method that is specially recognized by the "github.com/go-json-experiment/json" runtime.
internal/jsonopts/options_format.go:28
Method
F
()
v1/decode_test.go:296
Function
FormatByteArrayAsArray
FormatByteArrayAsArray specifies that a Go [N]byte is formatted as a normal Go array in contrast to the v2 default of formatting [N]byte as using bina
v1/alias.go:612
Function
FormatByteArrayAsArray
FormatByteArrayAsArray specifies that a Go [N]byte is formatted as a normal Go array in contrast to the v2 default of formatting [N]byte as using bina
v1/options.go:282
Function
FormatBytesWithLegacySemantics
FormatBytesWithLegacySemantics specifies that handling of []~byte and [N]~byte types follow legacy semantics: - A Go []~byte is to be treated as usin
v1/alias.go:635
Function
FormatBytesWithLegacySemantics
FormatBytesWithLegacySemantics specifies that handling of []~byte and [N]~byte types follow legacy semantics: - A Go []~byte is to be treated as usin
v1/options.go:309
Function
FormatDurationAsNano
FormatDurationAsNano specifies that a [time.Duration] is formatted as a JSON number representing the number of nanoseconds in contrast to the v2 defau
v1/alias.go:645
Function
FormatDurationAsNano
FormatDurationAsNano specifies that a [time.Duration] is formatted as a JSON number representing the number of nanoseconds in contrast to the v2 defau
v1/options.go:323
Function
FormatNilMapAsNull
FormatNilMapAsNull specifies that a nil Go map should marshal as a JSON null instead of the default representation as an empty JSON object. This only
options.go:166
Function
FormatNilSliceAsNull
FormatNilSliceAsNull specifies that a nil Go slice should marshal as a JSON null instead of the default representation as an empty JSON array (or an e
options.go:154
Function
FuzzCoder
(f *testing.F)
jsontext/fuzz_test.go:20
Function
FuzzCompareUTF16
(f *testing.F)
internal/jsonwire/wire_test.go:50
Function
FuzzDecoderToken
(f *testing.F)
v1/fuzz_test.go:55
Function
FuzzEqualFold
(f *testing.F)
fuzz_test.go:14
Function
FuzzFormatDuration
(f *testing.F)
arshal_time_test.go:240
Function
FuzzFormatTime
(f *testing.F)
arshal_time_test.go:360
Function
FuzzParseDuration
(f *testing.F)
arshal_time_test.go:259
Function
FuzzParseTime
(f *testing.F)
arshal_time_test.go:380
Function
FuzzResumableDecoder
(f *testing.F)
jsontext/fuzz_test.go:109
Function
FuzzUnmarshalJSON
(f *testing.F)
v1/fuzz_test.go:15
Function
FuzzValueFormat
(f *testing.F)
jsontext/fuzz_test.go:140
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
options.go:95
Function
HTMLEscape
HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 characters inside string literals changed to \u003c, \u003e, \u0026, \u
v1/indent.go:21
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/indent.go:83
Function
Int
Int constructs a Token representing a JSON number from an int64.
jsontext/token.go:190
Method
IsValid
IsValid reports whether p is a valid JSON Pointer according to RFC 6901. Note that the concatenation of two valid pointers produces a valid pointer.
jsontext/state.go:99
Method
IsZero
()
arshal_test.go:729
Method
IsZero
()
arshal_test.go:730
Method
IsZero
()
arshal_test.go:731
Method
IsZero
()
arshal_test.go:732
Method
IsZero
()
fields.go:26
Method
IsZero
()
v1/encode_test.go:80
Method
IsZero
()
v1/encode_test.go:88
Method
JSONOptions
(internal.NotForPublicUse)
options.go:256
Method
JSONOptions
(internal.NotForPublicUse)
options.go:257
Method
JSONOptions
JSONOptions is exported so related json packages can implement Options.
internal/jsonopts/options.go:17
Method
JSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:68
Method
JSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:214
Method
JSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:215
Method
JSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:216
Method
JSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:217
Method
JSONOptions
(internal.NotForPublicUse)
internal/jsonflags/flags.go:22
Function
JoinOptions
JoinOptions coalesces the provided list of options into a single Options. Properties set in later options override the value of previously set propert
options.go:77
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
arshal_funcs.go:67
Method
Kind
Kind returns the starting token kind. For a valid value, this will never include [KindEndObject] or [KindEndArray].
jsontext/value.go:259
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
arshal.go:164
Function
MarshalEncode
MarshalEncode serializes a Go value into an [jsontext.Encoder] according to the provided marshal or encode options (while ignoring unmarshal or decode
arshal.go:200
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/encode.go:191
Method
MarshalJSON
()
arshal_test.go:616
Method
MarshalJSON
()
arshal_test.go:670
Method
MarshalJSON
()
arshal_test.go:693
Method
MarshalJSON
()
arshal_test.go:720
Method
MarshalJSON
()
arshal_test.go:721
Method
MarshalJSON
()
arshal_test.go:722
Method
MarshalJSON
()
arshal_test.go:723
Method
MarshalJSON
()
arshal_test.go:724
Method
MarshalJSON
()
arshal_test.go:725
Method
MarshalJSON
()
arshal_test.go:726
Method
MarshalJSON
()
arshal_test.go:727
Method
MarshalJSON
()
bench_test.go:297
Method
MarshalJSON
()
internal/jsontest/testdata.go:601
← previous
next →
601–700 of 1,017, ranked by callers