Documentation ¶
Index ¶
- func Marshal(ctx *Context, data any) ([]byte, error)
- func ToString(data any) string
- type Context
- func (c *Context) Full() *Context
- func (c *Context) IncludeDebugFullLoc(include bool) *Context
- func (c *Context) IncludeDebugIndex(include bool) *Context
- func (c *Context) IncludeDebugKind(include bool) *Context
- func (c *Context) IncludeDebugReceiver(include bool) *Context
- func (c *Context) IsDebugFullLocIncluded() bool
- func (c *Context) IsDebugIndexIncluded() bool
- func (c *Context) IsDebugKindIncluded() bool
- func (c *Context) IsDebugReceiverIncluded() bool
- func (c *Context) IsMinimized() bool
- func (c *Context) IsOnlyIndex() bool
- func (c *Context) IsShort() bool
- func (c *Context) OnlyIndex() *Context
- func (c *Context) SetMinimize(min bool) *Context
- func (c *Context) Short() *Context
- type Datum
- type Jsonable
- type List
- type Map
- func (m *Map) Add(ctx *Context, key string, value any) *Map
- func (m *Map) AddIf(ctx *Context, test bool, key string, value any) *Map
- func (m *Map) AddNonZero(ctx *Context, key string, value any) *Map
- func (m *Map) AddNonZeroIf(ctx *Context, test bool, key string, value any) *Map
- func (m *Map) Get(key string) Datum
- func (m *Map) MarshalJSON() ([]byte, error)
- func (m *Map) RawValue() any
- func (m *Map) Seek(path []any) Datum
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext() *Context
func (*Context) Full ¶
Full indicates that objects should output the whole object, not a shortened version.
func (*Context) IncludeDebugFullLoc ¶
IncludeDebugFullLoc sets if the full location information should be included in the object model for debugging.
func (*Context) IncludeDebugIndex ¶
IncludeDebugIndex indicates that the index should be included to the output model for debugging.
func (*Context) IncludeDebugKind ¶
IncludeDebugKind indicates that the kind field should be included to the output model for debugging.
func (*Context) IncludeDebugReceiver ¶
IncludeDebugReceiver sets if the methods should include receiver information in the object model for debugging.
func (*Context) IsDebugFullLocIncluded ¶
IsDebugFullLocIncluded indicates that the full location information should be included in the object model for debugging.
func (*Context) IsDebugIndexIncluded ¶
IsDebugIndexIncluded indicates that the index should be included to the output model for debugging.
func (*Context) IsDebugKindIncluded ¶
IsDebugKindIncluded indicates that the kind field should be included to the output model for debugging.
func (*Context) IsDebugReceiverIncluded ¶
IsDebugReceiverIncluded indicates that methods should include receiver information in the object model for debugging.
func (*Context) IsMinimized ¶
IsMinimized indicates that the output JSON should be minimized.
func (*Context) IsOnlyIndex ¶
IsOnlyIndex indicates that objects should output only index as a reference to the whole object defined elsewhere.
func (*Context) IsShort ¶
IsShort indicates that objects should output only an identifier or index as a reference to the whole object defined elsewhere.
func (*Context) OnlyIndex ¶
OnlyIndex indicates that objects should output only an index as a reference to the rest of the object defined elsewhere.
func (*Context) SetMinimize ¶
SetMinimize sets if the output JSON should be minimized.
type Datum ¶
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) MarshalJSON ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func (*Map) AddNonZeroIf ¶
func (*Map) MarshalJSON ¶
type Value ¶
type Value struct {
// contains filtered or unexported fields
}