jsonx

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package jsonx holds the byte-level JSON checks that the root batchdata package and the service packages share: the shape of a raw value, and a count of the containers and values in a document.

It is neutral: it never imports the root batchdata package, and it works only on input that is already valid JSON, as json.Valid or json.Unmarshal has checked it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(data []byte) (containers, values int)

Count counts the objects and arrays (containers) and all values (keys excluded) in data, which must be valid JSON. It allocates only its nesting stack, which json.Valid has already bounded.

func IsArray

func IsArray(raw []byte) bool

IsArray reports whether the valid JSON value raw is an array.

func IsObject

func IsObject(raw []byte) bool

IsObject reports whether the valid JSON value raw is an object.

func Present

func Present(raw []byte) bool

Present reports whether raw holds a value other than null.

Types

This section is empty.

Jump to

Keyboard shortcuts

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