package jsonopts
import "github.com/go-json-experiment/json/internal/jsonopts"
Index ¶
- Variables
- func GetOption[T any](opts Options, setter func(T) Options) (T, bool)
- type ArshalValues
- type ByteLimit
- type CoderValues
- type DepthLimit
- type Indent
- type IndentPrefix
- type Options
- type Struct
Variables ¶
var DefaultOptionsV1 = Struct{ Flags: jsonflags.Flags{ Presence: uint64(jsonflags.AllFlags & ^jsonflags.WhitespaceFlags), Values: uint64(jsonflags.DefaultV1Flags), }, }
DefaultOptionsV1 is the set of all options that define default v1 behavior.
var DefaultOptionsV2 = Struct{ Flags: jsonflags.Flags{ Presence: uint64(jsonflags.AllFlags & ^jsonflags.WhitespaceFlags), Values: uint64(0), }, }
DefaultOptionsV2 is the set of all options that define default v2 behavior.
GetUnknownOption is injected by the "json" package to handle Options declared in that package so that "jsonopts" can handle them.
JoinUnknownOption is injected by the "json" package to handle Options declared in that package so that "jsonopts" can handle them.
Functions ¶
func GetOption ¶
Types ¶
type ArshalValues ¶
type ArshalValues struct { Marshalers any // jsonflags.Marshalers Unmarshalers any // jsonflags.Unmarshalers Format string FormatDepth int }
type ByteLimit ¶
type ByteLimit int64 // jsontext.WithByteLimit
func (ByteLimit) JSONOptions ¶
func (ByteLimit) JSONOptions(internal.NotForPublicUse)
type CoderValues ¶
type CoderValues struct { Indent string // jsonflags.Indent IndentPrefix string // jsonflags.IndentPrefix ByteLimit int64 // jsonflags.ByteLimit DepthLimit int // jsonflags.DepthLimit }
type DepthLimit ¶
type DepthLimit int // jsontext.WithDepthLimit
func (DepthLimit) JSONOptions ¶
func (DepthLimit) JSONOptions(internal.NotForPublicUse)
type Indent ¶
type Indent string // jsontext.WithIndent
func (Indent) JSONOptions ¶
func (Indent) JSONOptions(internal.NotForPublicUse)
type IndentPrefix ¶
type IndentPrefix string // jsontext.WithIndentPrefix
func (IndentPrefix) JSONOptions ¶
func (IndentPrefix) JSONOptions(internal.NotForPublicUse)
type Options ¶
type Options interface { // JSONOptions is exported so related json packages can implement Options. JSONOptions(internal.NotForPublicUse) }
Options is the common options type shared across json packages.
type Struct ¶
type Struct struct { Flags jsonflags.Flags CoderValues ArshalValues }
Struct is the combination of all options in struct form. This is efficient to pass down the call stack and to query.
func (*Struct) JSONOptions ¶
func (*Struct) JSONOptions(internal.NotForPublicUse)
func (*Struct) Join ¶
func (*Struct) JoinWithoutCoderOptions ¶
Source Files ¶
- Version
- v0.0.0-20250223041408-d3c622f1b874 (latest)
- Published
- Feb 23, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 month ago –
Tools for package owners.