MCPcopy Create free account

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

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

↓ 1,563 callersFunctionName
Name annotates a case name with the file and line of the caller.
internal/jsontest/testcase.go:24
↓ 904 callersFunctionaddr
(v T)
arshal_test.go:737
↓ 335 callersMethodwithPos
(prefix string, pointer Pointer)
jsontext/coder_test.go:36
↓ 282 callersMethodwithType
(k jsontext.Kind, t reflect.Type)
arshal_test.go:70
↓ 277 callersMethodGet
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 callersFunctionE
(err error)
jsontext/coder_test.go:24
↓ 210 callersFunctionString
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 callersMethodwithPos
(prefix string, pointer jsontext.Pointer)
arshal_test.go:64
↓ 137 callersFunctionEU
(err error)
arshal_test.go:55
↓ 99 callersFunctionnewInvalidCharacterError
(prefix, where string)
jsontext/coder_test.go:28
↓ 96 callersFunctionEM
(err error)
arshal_test.go:51
↓ 91 callersFunctionExperimentalSupportFormatTag
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 callersMethodKind
()
jsontext/coder_test.go:52
↓ 82 callersFunctionT
()
arshal_test.go:82
↓ 77 callersFunctionWithMarshalers
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 callersFunctionlen64
(in Bytes)
bench_test.go:126
↓ 74 callersMethodSet
Set sets both the presence and value for the provided bool (or set of bools).
internal/jsonflags/flags.go:188
↓ 74 callersFunctionlen64
(s string)
v1/decode_test.go:28
↓ 66 callersMethodString
()
v1/stream.go:205
↓ 64 callersMethodWriteToken
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 callersMethodHas
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 callersFunctionMarshal
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 callersMethodReadToken
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 callersFunctionWithUnmarshalers
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 callersFunctionrawToken
(s string)
jsontext/token.go:128
↓ 53 callersFunctionAllowDuplicateNames
AllowDuplicateNames specifies that JSON objects may contain duplicate member names. Disabling the duplicate name check may provide performance benefit
jsontext/alias.go:239
↓ 53 callersMethodReadValue
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 callersFunctionMarshalToFunc
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 callersFunctionNewInvalidCharacterError
(prefix Bytes, where string)
internal/jsonwire/wire.go:129
↓ 48 callersMethodmakeError
(off int, msg string)
internal/zstd/zstd.go:496
↓ 47 callersFunctionMarshalFunc
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 callersFunctionmustParseTime
(layout, value string)
arshal_test.go:741
↓ 46 callersMethodJoin
Join joins two sets of flags such that the latter takes precedence.
internal/jsonflags/flags.go:176
↓ 45 callersFunctionUnmarshal
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 callersMethodWriteValue
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 callersFunctionAllowInvalidUTF8
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 callersMethodDecoder
Decoder returns a pointer to the underlying decoderState.
jsontext/export.go:58
↓ 43 callersFunctionnewMarshalErrorBefore
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 callersMethodDecode
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 callersFunctionMultiline
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 callersFunctionUnmarshalFromFunc
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 callersFunctionaddr
(v T)
v1/decode_test.go:2062
↓ 39 callersMethodwithVal
(val string)
arshal_test.go:59
↓ 37 callersFunctionStringifyNumbers
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 callersFunctionwrapSyntacticError
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 callersFunctionnewDuplicateNameError
(ptr jsontext.Pointer, quotedName []byte, offset int64)
errors.go:447
↓ 34 callersMethodString
String prints the kind in a humanly readable fashion.
jsontext/token.go:643
↓ 33 callersMethodNeedObjectName
NeedObjectName reports whether the next token must be a JSON string, which is necessary for JSON object names.
jsontext/state.go:474
↓ 33 callersFunctionUint
Uint constructs a Token representing a JSON number from a uint64.
jsontext/alias.go:512
↓ 32 callersMethodEncoder
Encoder returns a pointer to the underlying encoderState.
jsontext/export.go:55
↓ 31 callersMethodPeekKind
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 callersFunctionUnmarshalFunc
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 callersMethodDepth
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 callersFunctionUnmarshal
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 callersFunctionaddr
(v T)
bench_test.go:122
↓ 28 callersFunctionConsumeWhitespace
ConsumeWhitespace consumes leading JSON whitespace per RFC 7159, section 2.
internal/jsonwire/decode.go:33
↓ 28 callersFunctionNewDecoder
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 callersFunctionnewUnmarshalErrorAfter
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 callersFunctionnewInvalidFormatError
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 callersFunctionGetOption
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 callersMethodLength
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 callersMethodreset
()
jsontext/state.go:76
↓ 24 callersFunctionFloat
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 callersMethodError
()
v1/scanner.go:52
↓ 22 callersFunctionMarshal
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 callersFunctionNewInvalidEscapeSequenceError
(what Bytes)
internal/jsonwire/wire.go:134
↓ 19 callersMethodIsValid
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 callersFunctionNewDecoder
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 callersFunctionindentNewlines
(s string)
v1/scanner_test.go:18
↓ 19 callersMethodlookup
(fnc func(*Coder, addressableValue, *jsonopts.Struct) error, t reflect.Type)
arshal_funcs.go:114
↓ 19 callersMethodmakeEOFError
(off int)
internal/zstd/zstd.go:485
↓ 18 callersMethodneedMore
needMore reports whether there are no more unread bytes.
jsontext/decode.go:275
↓ 17 callersMethodInputOffset
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 callersMethodReset
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 callersFunctionUnquoteMayCopy
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 callersFunctionDeterministic
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 callersMethodWrite
(b []byte)
jsontext/coder_test.go:823
↓ 16 callersMethodconsumeWhitespace
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 callersFunctionnewAddressableValue
newAddressableValue constructs a new addressable value of type t.
arshal.go:510
↓ 15 callersMethodCompare
(y objectMember)
jsontext/value.go:277
↓ 15 callersMethodEncode
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 callersMethodIsVerbatim
()
internal/jsonwire/decode.go:29
↓ 15 callersFunctionequalError
(x, y error)
jsontext/coder_test.go:42
↓ 15 callersMethodval
val is called to fetch a value of b bits.
internal/zstd/bits.go:50
↓ 15 callersFunctionwrapWithObjectName
wrapWithObjectName wraps err with a JSON object name access, which must be a valid quoted JSON string.
jsontext/errors.go:183
↓ 14 callersMethodIncrement
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 callersFunctionJoinMarshalers
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 callersMethodString
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 callersFunctionbaseLabel
(base uint64)
arshal_time_test.go:20
↓ 14 callersFunctionnewUnmarshalErrorBeforeWithSkipping
newUnmarshalErrorBeforeWithSkipping is like [newUnmarshalErrorBefore], but automatically skips the next value if [jsonflags.ReportErrorsWithLegacySema
errors.go:152
↓ 14 callersMethodnormalize
normalize coalesces all possible starting characters of a number as just '0', and converts all invalid kinds to 0.
jsontext/token.go:694
↓ 14 callersFunctionstripWhitespace
(s string)
v1/scanner_test.go:22
↓ 13 callersMethodAvailableBuffer
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 callersMethodJoin
(f2 ValueFlags)
internal/jsonwire/decode.go:28
↓ 13 callersFunctionNewEncoder
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 callersFunctionnewInvalidCharacterError
(prefix, where string, offset int64, pointer jsontext.Pointer)
arshal_test.go:39
↓ 12 callersFunctionAppendQuote
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 callersMethodFlush
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 callersMethodIsIOError
(err error)
jsontext/export.go:88
↓ 12 callersMethodLast
Last returns a pointer to the last JSON object namespace.
jsontext/state.go:699
next →1–100 of 1,017, ranked by callers