json

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryNone = "json"
	QueryGeo  = "geo"
	QueryHAR  = "har"
	QueryGLTF = "gltf"
)
View Source
const (
	TokInvalid = 0
	TokNull    = 1 << iota
	TokTrue
	TokFalse
	TokNumber
	TokString
	TokArray
	TokObject
	TokComma
)

Variables

This section is empty.

Functions

func LooksLikeObjectOrArray added in v0.17.2

func LooksLikeObjectOrArray(raw []byte) bool

LooksLikeObjectOrArray reports if first non white space character from raw is either { or [. Parsing raw as JSON is a heavy operation. When receiving some text input we can skip parsing if the input does not even look like JSON.

func Parse added in v0.17.2

func Parse(queryType string, raw []byte) (parsed, inspected, firstToken int, querySatisfied bool)

Parse will take out a parser from the pool depending on queryType and tries to parse raw bytes as JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL