jsonkey

package
v1.10.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package jsonkey defines canonical JSON object member names for DSL map keys.

Index

Constants

This section is empty.

Variables

View Source
var BooleanKeys = json.JoinOptions(
	json.WithMarshalers(json.MarshalToFunc[any](marshalBooleanKey)),
	json.WithUnmarshalers(json.UnmarshalFromFunc[any](unmarshalBooleanKey)),
)

BooleanKeys extends JSON encoding and decoding with canonical boolean map keys, named "true" and "false". Boolean values and types with custom JSON or text representations retain the JSON library's behavior.

Functions

func HasCustomEncoding

func HasCustomEncoding(valueType reflect.Type) bool

HasCustomEncoding reports whether JSON serialization owns the type's representation. JSON v2 also checks pointer methods on addressable copies.

func Name

func Name(key reflect.Value) (string, bool)

Name returns the JSON object member name of a string, boolean, or finite numeric map key, including named scalar types and interface wrappers. It reports false for nil, non-finite numbers, and unsupported key kinds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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