MCPcopy Create free account

hub / github.com/go-json-experiment/json / functions

Functions1,017 in github.com/go-json-experiment/json

MethodError
()
internal/jsonwire/wire.go:147
MethodError
()
internal/zstd/zstd.go:477
MethodError
()
v1/encode.go:213
MethodError
()
v1/encode.go:224
MethodError
()
v1/encode.go:238
MethodError
()
v1/encode.go:250
MethodError
()
v1/decode.go:172
MethodError
()
v1/decode.go:182
MethodError
()
jsontext/errors.go:39
MethodError
()
jsontext/errors.go:120
FunctionEscapeForHTML
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
FunctionEscapeForJS
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
FunctionExampleDecoder
This example uses a Decoder to decode a stream of distinct JSON values.
v1/example_test.go:60
FunctionExampleDecoder_Decode_stream
This example uses a Decoder to decode a streaming array of JSON objects.
v1/example_test.go:127
FunctionExampleDecoder_Token
This example uses a Decoder to decode a stream of distinct JSON values.
v1/example_test.go:90
FunctionExampleEscapeForHTML
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
FunctionExampleHTMLEscape
()
v1/example_test.go:307
FunctionExampleIndent
()
v1/example_test.go:248
FunctionExampleMarshal
()
v1/example_test.go:20
FunctionExampleMarshalIndent
()
v1/example_test.go:279
FunctionExampleRawMessage_marshal
This example uses RawMessage to use a precomputed JSON during marshal.
v1/example_test.go:225
FunctionExampleRawMessage_unmarshal
This example uses RawMessage to delay parsing part of a JSON message.
v1/example_test.go:179
FunctionExampleUnmarshal
()
v1/example_test.go:40
FunctionExampleValid
()
v1/example_test.go:298
FunctionExampleWithMarshalers_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
FunctionExampleWithUnmarshalers_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
FunctionExampleWithUnmarshalers_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
FunctionExample_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
FunctionExample_customMarshalJSON
()
v1/example_marshaling_test.go:56
FunctionExample_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
FunctionExample_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
FunctionExample_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
FunctionExample_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
FunctionExample_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
FunctionExample_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
FunctionExample_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
FunctionExample_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
FunctionExample_textMarshalJSON
()
v1/example_text_marshaling_test.go:50
MethodExperimentalSupportFormatTag
ExperimentalSupportFormatTag is a marker method that is specially recognized by the "encoding/json/v2" runtime.
options_format.go:26
MethodExperimentalSupportFormatTag
ExperimentalSupportFormatTag is a marker method that is specially recognized by the "github.com/go-json-experiment/json" runtime.
internal/jsonopts/options_format.go:28
MethodF
()
v1/decode_test.go:296
FunctionFormatByteArrayAsArray
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
FunctionFormatByteArrayAsArray
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
FunctionFormatBytesWithLegacySemantics
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
FunctionFormatBytesWithLegacySemantics
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
FunctionFormatDurationAsNano
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
FunctionFormatDurationAsNano
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
FunctionFormatNilMapAsNull
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
FunctionFormatNilSliceAsNull
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
FunctionFuzzCoder
(f *testing.F)
jsontext/fuzz_test.go:20
FunctionFuzzCompareUTF16
(f *testing.F)
internal/jsonwire/wire_test.go:50
FunctionFuzzDecoderToken
(f *testing.F)
v1/fuzz_test.go:55
FunctionFuzzEqualFold
(f *testing.F)
fuzz_test.go:14
FunctionFuzzFormatDuration
(f *testing.F)
arshal_time_test.go:240
FunctionFuzzFormatTime
(f *testing.F)
arshal_time_test.go:360
FunctionFuzzParseDuration
(f *testing.F)
arshal_time_test.go:259
FunctionFuzzParseTime
(f *testing.F)
arshal_time_test.go:380
FunctionFuzzResumableDecoder
(f *testing.F)
jsontext/fuzz_test.go:109
FunctionFuzzUnmarshalJSON
(f *testing.F)
v1/fuzz_test.go:15
FunctionFuzzValueFormat
(f *testing.F)
jsontext/fuzz_test.go:140
FunctionGetOption
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
FunctionHTMLEscape
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
FunctionIndent
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
FunctionInt
Int constructs a Token representing a JSON number from an int64.
jsontext/token.go:190
MethodIsValid
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
MethodIsZero
()
arshal_test.go:729
MethodIsZero
()
arshal_test.go:730
MethodIsZero
()
arshal_test.go:731
MethodIsZero
()
arshal_test.go:732
MethodIsZero
()
fields.go:26
MethodIsZero
()
v1/encode_test.go:80
MethodIsZero
()
v1/encode_test.go:88
MethodJSONOptions
(internal.NotForPublicUse)
options.go:256
MethodJSONOptions
(internal.NotForPublicUse)
options.go:257
MethodJSONOptions
JSONOptions is exported so related json packages can implement Options.
internal/jsonopts/options.go:17
MethodJSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:68
MethodJSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:214
MethodJSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:215
MethodJSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:216
MethodJSONOptions
(internal.NotForPublicUse)
internal/jsonopts/options.go:217
MethodJSONOptions
(internal.NotForPublicUse)
internal/jsonflags/flags.go:22
FunctionJoinOptions
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
FunctionJoinUnmarshalers
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
MethodKind
Kind returns the starting token kind. For a valid value, this will never include [KindEndObject] or [KindEndArray].
jsontext/value.go:259
FunctionMarshal
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
FunctionMarshalEncode
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
FunctionMarshalIndent
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
MethodMarshalJSON
()
arshal_test.go:616
MethodMarshalJSON
()
arshal_test.go:670
MethodMarshalJSON
()
arshal_test.go:693
MethodMarshalJSON
()
arshal_test.go:720
MethodMarshalJSON
()
arshal_test.go:721
MethodMarshalJSON
()
arshal_test.go:722
MethodMarshalJSON
()
arshal_test.go:723
MethodMarshalJSON
()
arshal_test.go:724
MethodMarshalJSON
()
arshal_test.go:725
MethodMarshalJSON
()
arshal_test.go:726
MethodMarshalJSON
()
arshal_test.go:727
MethodMarshalJSON
()
bench_test.go:297
MethodMarshalJSON
()
internal/jsontest/testdata.go:601
← previousnext →601–700 of 1,017, ranked by callers