Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/buger/jsonparser
/ functions
Functions
1,168 in github.com/buger/jsonparser
⨍
Functions
1,168
◇
Types & classes
46
↓ 204 callers
Function
Get
* Get - Receives data structure, and key path to extract value from. Returns: `value` - Pointer to original data structure containing key value, or j
parser.go:1564
↓ 72 callers
Function
ArrayEach
SYS-REQ-006, SYS-REQ-028, SYS-REQ-029, SYS-REQ-052, SYS-REQ-053, SYS-REQ-055, SYS-REQ-083 ArrayEach is used when iterating arrays, accepts a callback
parser.go:1604
↓ 71 callers
Function
Delete
* Del - Receives existing data structure, path to delete. Returns: `data` - return modified data */ SYS-REQ-010, SYS-REQ-033, SYS-REQ-034, SYS-REQ-
parser.go:1182
↓ 68 callers
Function
Set
* Set - Receives existing data structure, path to set, and data to set at that key. Returns: `value` - modified byte array `err` - On any parsing er
parser.go:1341
↓ 51 callers
Function
GetString
SYS-REQ-002, SYS-REQ-071, SYS-REQ-072, SYS-REQ-073, SYS-REQ-074 GetString returns the value retrieved by `Get`, cast to a string if possible, trying t
parser.go:1947
↓ 48 callers
Function
EachKey
SYS-REQ-008, SYS-REQ-085, SYS-REQ-111
parser.go:587
↓ 48 callers
Function
ObjectEach
SYS-REQ-007, SYS-REQ-030, SYS-REQ-031, SYS-REQ-032, SYS-REQ-054, SYS-REQ-084 ObjectEach iterates over the key-value pairs of a JSON object, invoking a
parser.go:1810
↓ 46 callers
Function
GetInt
GetInt returns the value retrieved by `Get`, cast to a int64 if possible. If key data type do not match, it will return an error. SYS-REQ-003, SYS-REQ
parser.go:1993
↓ 45 callers
Method
String
SYS-REQ-001
parser.go:1046
↓ 44 callers
Function
ParseInt
ParseInt parses a Number ValueType into a Go int64 SYS-REQ-015, SYS-REQ-039, SYS-REQ-040, SYS-REQ-058, SYS-REQ-059, SYS-REQ-064
parser.go:2067
↓ 41 callers
Function
ParseString
ParseString parses a String ValueType into a Go string (the main parsing work is unescaping the JSON string) SYS-REQ-014, SYS-REQ-038, SYS-REQ-060, SY
parser.go:2046
↓ 34 callers
Function
nothing
Just for emulating field access, so it will not throw "evaluated but not used" Benchmark helper for STK-REQ-001, STK-REQ-003, STK-REQ-004, STK-REQ-005
benchmark/benchmark_small_payload_test.go:28
↓ 33 callers
Function
GetUnsafeString
SYS-REQ-011, SYS-REQ-080, SYS-REQ-081, SYS-REQ-082 GetUnsafeString returns the value retrieved by `Get`, use creates string without memory allocation
parser.go:1934
↓ 24 callers
Function
ParseBoolean
ParseBoolean parses a Boolean ValueType into a Go bool (not particularly useful, but here for completeness) SYS-REQ-012, SYS-REQ-036, SYS-REQ-057, SYS
parser.go:2033
↓ 19 callers
Function
Unescape
unescape unescapes the string contained in 'in' and returns it as a slice. If 'in' contains no escaped characters: Returns 'in'. Else, if 'out' is
escape.go:284
↓ 18 callers
Function
newRNG
(seed int64)
property_test.go:38
↓ 17 callers
Function
GetBoolean
GetBoolean returns the value retrieved by `Get`, cast to a bool if possible. The offset is the same as in `Get`. If key data type do not match, it wil
parser.go:2014
↓ 17 callers
Function
ParseFloat
ParseNumber parses a Number ValueType into a Go float64 SYS-REQ-013, SYS-REQ-037, SYS-REQ-065
parser.go:2057
↓ 14 callers
Function
addSeeds
(f *testing.F)
fuzz_native_test.go:52
↓ 14 callers
Function
runNoPanic
Regression coverage for the empty-string key path component hazard (hazard-sweep finding). A caller passing "" as a path component used to trigger `ru
empty_key_path_test.go:23
↓ 14 callers
Function
runWithCapture
(target string, data []byte, fn func([]byte))
fuzz_native_test.go:103
↓ 13 callers
Method
Get
Get returns the value addressed by keys using c's parsing options. SYS-REQ-115
config.go:31
↓ 12 callers
Function
GetFloat
GetFloat returns the value retrieved by `Get`, cast to a float64 if possible. The offset is the same as in `Get`. If key data type do not match, it wi
parser.go:1973
↓ 11 callers
Method
CodecDecodeSelf
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:1112
↓ 11 callers
Function
stringEnd
SYS-REQ-045 Tries to find the end of string Support if string contains escaped quote symbols.
parser.go:296
↓ 11 callers
Function
tokenEnd
SYS-REQ-044 reqproof:lemma tokenEnd_in_range func(data []byte) bool { r := tokenEnd(data) return r >= 0 && r <= len(data) } reqproof:lemma
parser.go:55
↓ 10 callers
Method
peekByte
peekByte returns the next byte. When retain is false, fully consumed chunks are discarded before reading more data. SYS-REQ-116
reader_parser.go:609
↓ 10 callers
Function
searchKeys
SYS-REQ-001, SYS-REQ-020, SYS-REQ-021, SYS-REQ-022, SYS-REQ-023, SYS-REQ-047, SYS-REQ-111
parser.go:408
↓ 9 callers
Method
GetString
GetString returns the decoded string addressed by keys using c's parsing options. SYS-REQ-115
config.go:39
↓ 9 callers
Function
NewReaderParser
NewReaderParser creates a streaming parser. If opts contains a Config, the first Config controls lenient parsing and the sliding-window size. SYS-REQ-
reader_parser.go:37
↓ 8 callers
Method
UnmarshalEasyJSON
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_easyjson.go:283
↓ 8 callers
Function
nextTokenConfig
SYS-REQ-115
parser.go:241
↓ 8 callers
Function
randKey
(r *mathrand.Rand)
property_test.go:83
↓ 7 callers
Method
Get
Get returns the value addressed by keys without loading the whole document. As with the package-level Get, string values are returned without quotes b
reader_parser.go:52
↓ 7 callers
Function
nextToken
SYS-REQ-001 Find position of next character which is not whitespace reqproof:lemma nextToken_in_range func(data []byte) bool { r := nextToken(dat
parser.go:236
↓ 7 callers
Function
runGetTests
Test helper for SYS-REQ-001, SYS-REQ-002, SYS-REQ-003, SYS-REQ-004, SYS-REQ-005, and SYS-REQ-011.
parser_test.go:1233
↓ 7 callers
Function
unescapeConfig
SYS-REQ-115
escape.go:289
↓ 6 callers
Function
ArrayEachErr
ArrayEachErr is used when iterating arrays and allows the callback to stop iteration by returning an error. io.EOF stops iteration without returning a
parser.go:1713
↓ 6 callers
Method
CodecEncodeSelf
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_codecgen.go:1053
↓ 6 callers
Function
CompilePath
CompilePath parses jsonPath once for reuse. SYS-REQ-114
path_compiler.go:167
↓ 6 callers
Method
MarshalJSONBuf
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:685
↓ 6 callers
Function
assertInputUnchanged
(t *testing.T, data []byte, fn func())
property_test.go:151
↓ 6 callers
Function
encodingJSONNoPanic
============================================================================= Shared helpers =========================================================
encoding_json_fuzz_test.go:113
↓ 6 callers
Function
randomBytes
randomBytes returns arbitrary (usually non-JSON) bytes from a seeded RNG.
property_test.go:131
↓ 6 callers
Function
recoverNoPanic
recoverNoPanic runs fn and reports whether it returned without panicking.
property_test.go:141
↓ 6 callers
Method
skipWhitespace
SYS-REQ-116
reader_parser.go:593
↓ 6 callers
Function
splitPathComponents
splitPathComponents interprets the fuzz path bytes as a '/'-separated list of key components. Empty segments (from "", "a/", "/a", "a//b", etc.) becom
path_fuzz_test.go:119
↓ 6 callers
Function
stringEndConfig
SYS-REQ-115
parser.go:301
↓ 6 callers
Function
truncateForMsg
truncateForMsg renders a byte slice for inclusion in an error message, truncating very large inputs (e.g. the 100 KB deep-nesting seed) so test output
encoding_json_fuzz_test.go:127
↓ 5 callers
Function
Escape
Escape returns in as a JSON string literal, including the surrounding quotation marks. SYS-REQ-014
escape.go:230
↓ 5 callers
Method
MarshalEasyJSON
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_easyjson.go:278
↓ 5 callers
Function
ParsePath
ParsePath converts a JSONPath-style path into the path components accepted by Get, Set, Delete, ArrayEach, and EachKey. SYS-REQ-114
path_compiler.go:17
↓ 5 callers
Function
createInsertComponent
SYS-REQ-009, SYS-REQ-110, SYS-REQ-111
parser.go:1074
↓ 5 callers
Function
decodeSingleUnicodeEscape
decodeSingleUnicodeEscape decodes a single \uXXXX escape sequence. The prefix \u is assumed to be present and is not checked. In JSON, these escapes c
escape.go:82
↓ 5 callers
Function
decodeUnicodeEscape
SYS-REQ-115
escape.go:123
↓ 5 callers
Function
equalStr
See fastbytes_unsafe.go for explanation on why *[]byte is used (signatures must be consistent with those in that file)
bytes_safe.go:12
↓ 5 callers
Function
genDeepNesting
genDeepNesting returns deeply-nested JSON array bytes. When closed is true the structure is complete ([[[...1...]]]); when false it is left unclosed (
encoding_json_fuzz_test.go:139
↓ 5 callers
Function
oracleNewRNG
oracleNewRNG returns a seeded RNG. Distinct name from property_test.go's newRNG so the two files can evolve independently without collision.
reference_oracle_test.go:119
↓ 5 callers
Function
randomJSONValue
randomJSONValue builds a random nested Go value suitable for encoding/json.Marshal. The shape (depth, breadth, alternatives) is chosen by the supplied
property_test.go:45
↓ 4 callers
Method
Error
SYS-REQ-116
reader_parser.go:694
↓ 4 callers
Function
GetArrayLen
GetArrayLen returns the number of elements in the addressed JSON array. It scans the array without invoking a callback. SYS-REQ-112
parser.go:2081
↓ 4 callers
Method
Set
Set replaces the value addressed by keys using c's parsing options. SYS-REQ-115
config.go:66
↓ 4 callers
Method
UnmarshalJSONFFLexer
Benchmark harness support for STK-REQ-004.
benchmark/benchmark_ffjson.go:716
↓ 4 callers
Function
applyMutation
applyMutation picks one operator at random and applies it.
json_fuzz_test.go:544
↓ 4 callers
Function
blockEnd
SYS-REQ-046 Find end of the data structure, array or object. For array openSym and closeSym will be '[' and ']', for object '{' and '}'
parser.go:369
↓ 4 callers
Function
blockEndConfig
SYS-REQ-115
parser.go:374
↓ 4 callers
Function
bytesToString
(b *[]byte)
bytes_safe.go:20
↓ 4 callers
Function
calcAllocateSpace
SYS-REQ-009, SYS-REQ-111
parser.go:1125
↓ 4 callers
Function
findKeyStart
SYS-REQ-001, SYS-REQ-020, SYS-REQ-024
parser.go:96
↓ 4 callers
Function
findStructuralBytes
findStructuralBytes returns the positions of all bytes in data that match any of targets. Returns nil if none are found.
json_fuzz_test.go:554
↓ 4 callers
Function
genJSON
genJSON returns a valid JSON document generated from the grammar. The output is always valid JSON per RFC 8259 (the corpus-sanity test asserts json.Va
json_fuzz_test.go:156
↓ 4 callers
Function
internalGetConfig
SYS-REQ-115
parser.go:1575
↓ 4 callers
Function
lastToken
SYS-REQ-001 Find position of last character which is not whitespace reqproof:lemma lastToken_in_range func(data []byte) bool { r := lastToken(dat
parser.go:279
↓ 4 callers
Function
parseInt
About 2x faster then strconv.ParseInt because it only supports base 10, which is enough for JSON
bytes.go:9
↓ 4 callers
Function
randomObjectJSONBytes
randomObjectJSONBytes returns marshaled JSON for a random top-level object along with the map so tests can predict values.
property_test.go:105
↓ 4 callers
Function
searchKeysConfig
SYS-REQ-115
parser.go:413
↓ 4 callers
Function
tokenStart
SYS-REQ-001 reqproof:lemma tokenStart_in_range func(data []byte) bool { r := tokenStart(data) return r >= 0 && r <= len(data) } reqproof:le
parser.go:197
↓ 3 callers
Function
ArrayEachWildcard
ArrayEachWildcard iterates over an array addressed by keys. A terminal [*] component is accepted as an explicit request for all elements; without it,
wildcard.go:72
↓ 3 callers
Function
GetObjectLen
GetObjectLen returns the number of key-value pairs in the addressed JSON object. It scans the object without invoking a callback. SYS-REQ-112
parser.go:2093
↓ 3 callers
Method
GetString
GetString returns and decodes the string addressed by keys. SYS-REQ-116
reader_parser.go:89
↓ 3 callers
Function
SetString
SetString replaces the value at keys with val encoded as a JSON string. SYS-REQ-009
escape.go:268
↓ 3 callers
Function
aliasErrorString
(err error)
aliases_test.go:31
↓ 3 callers
Function
arrayEachConfig
SYS-REQ-115
parser.go:1609
↓ 3 callers
Method
captureValue
SYS-REQ-116
reader_parser.go:438
↓ 3 callers
Function
deleteFoundConfig
SYS-REQ-115
parser.go:1195
↓ 3 callers
Method
discardConsumed
SYS-REQ-116
reader_parser.go:674
↓ 3 callers
Function
findTokenStart
SYS-REQ-001 NOTE: findTokenStart's two-conditional-return body shape exposes the translator's __early_val scoping bug; we leave it without an in-range
parser.go:82
↓ 3 callers
Method
findValue
findValue resolves keys[depth:] against the value at rp.pos. A not-found result consumes the current value so a containing object can continue past a
reader_parser.go:201
↓ 3 callers
Function
genValue
genValue appends one JSON value to buf, chosen from a weighted distribution that favors containers at shallow depth (to exercise nesting) and scalars
json_fuzz_test.go:165
↓ 3 callers
Function
internalGet
SYS-REQ-001
parser.go:1570
↓ 3 callers
Function
isJSONWhitespace
isJSONWhitespace reports whether b is one of the four JSON whitespace bytes (space 0x20, tab 0x09, LF 0x0A, CR 0x0D) per RFC 8259 §2. Used by Delete's
parser.go:74
↓ 3 callers
Function
newRandFromSeed
============================================================================= Deterministic RNG seeding from fuzz inputs =============================
json_fuzz_test.go:129
↓ 3 callers
Function
oracleRandomJSONBytes
oracleRandomJSONBytes returns marshaled JSON for a random value, plus the Go value itself (so callers can walk the tree to predict sub-values).
reference_oracle_test.go:256
↓ 3 callers
Function
pathShapeMatchesRoot
pathShapeMatchesRoot reports whether the path is semantically applicable to the JSON data's container structure. Used to gate the json.Valid post-cond
path_fuzz_test.go:411
↓ 3 callers
Function
pickExistingPath
--------------------------------------------------------------------------- Path picker — walks a random Go value tree to produce a path that EXISTS.
reference_oracle_test.go:270
↓ 3 callers
Function
randomJSONBytes
randomJSONBytes returns marshaled JSON for any random value.
property_test.go:121
↓ 3 callers
Function
referenceStringEnd
============================================================================= Focused equivalence tests for the stringEnd fast path (PR #285-style "fa
optimization_equiv_test.go:26
↓ 3 callers
Function
runParseTests
Test helper for SYS-REQ-012, SYS-REQ-013, SYS-REQ-014, and SYS-REQ-015.
parser_test.go:2193
↓ 3 callers
Function
sameTree
SYS-REQ-008
parser.go:569
↓ 3 callers
Method
scanString
SYS-REQ-116
reader_parser.go:482
next →
1–100 of 1,168, ranked by callers