package internal

import "github.com/go-json-experiment/json/internal"

Index

Variables

var (
	ErrCycle           = errors.New("encountered a cycle")
	ErrNonNilReference = errors.New("value must be passed as a non-nil pointer reference")
)

Sentinel error values internally shared between jsonv1 and jsonv2.

var (
	// TransformMarshalError converts a v2 error into a v1 error.
	// It is called only at the top-level of a Marshal function.
	TransformMarshalError func(any, error) error
	// NewMarshalerError constructs a jsonv1.MarshalerError.
	// It is called after a user-defined Marshal method/function fails.
	NewMarshalerError func(any, error, string) error
	// TransformUnmarshalError converts a v2 error into a v1 error.
	// It is called only at the top-level of a Unmarshal function.
	TransformUnmarshalError func(any, error) error

	// NewRawNumber returns new(jsonv1.Number).
	NewRawNumber func() any
	// RawNumberOf returns jsonv1.Number(b).
	RawNumberOf func(b []byte) any
)

Types

type NotForPublicUse

type NotForPublicUse struct{}

NotForPublicUse is a marker type that an API is for internal use only. It does not perfectly prevent usage of that API, but helps to restrict usage. Anything with this marker is not covered by the Go compatibility agreement.

var AllowInternalUse NotForPublicUse

AllowInternalUse is passed from "json" to "jsontext" to authenticate that the caller can have access to internal functionality.

Source Files

internal.go

Directories

PathSynopsis
internal/jsonflagsjsonflags implements all the optional boolean flags.
internal/jsonopts
internal/jsontestPackage jsontest contains functionality to assist in testing JSON.
internal/jsonwirePackage jsonwire implements stateless functionality for handling JSON text.
Version
v0.0.0-20250223041408-d3c622f1b874 (latest)
Published
Feb 23, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
3 months ago

Tools for package owners.