Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array []any
Array means array of anything.
func (*Array) UnmarshalJSON ¶
UnmarshalJSON converts []byte into an Array.
type Bool ¶
type Bool bool
Bool means a boolean value.
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON converts []byte into a Bool.
type CleanDecoder ¶
CleanDecoder is an interface that stands for the part of `*json.Decoder` that is required in dirty decoding. It also allows us to switch from std `json.Decoder` to other faster (std-compatible) decoders.
type Color ¶
type Color int
Color means the color of dirty unmarshalling.
const ( // ColorGreen means 100% clean unmarshalling. // Data could be unmarshalled directly into the target clean struct. ColorGreen Color = iota // ColorYellow means successful (lossless) unmarshalling via dirty schema. // At least one dirty concept was used. See `Warnings` to list them. ColorYellow // ColorRed means partially successful (lossy) unmarshalling via dirty schema. // At least one field was lost during unmarshalling. See `Errors` to list them. ColorRed )
type Date ¶
Date means a date (time pointing to a specific day).
func (*Date) UnmarshalJSON ¶
UnmarshalJSON converts []byte into a Date.
type DateTime ¶
DateTime means a time (time pointing to a specific moment).
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON converts []byte into a Date.
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is the dirty decoder, it wraps the "clean" decoder.
type Dirtyable ¶
type Dirtyable interface {
Dirty() any
}
Dirtyable is used as a way to link a clean model with a dirty model.
type Disabled ¶
type Disabled struct{}
Disabled is an atom struct that that remains a syntactically valid dirty model but disables dirty unmarshalling. You can easily switch from `dirty.Enabled` to `dirty.Disabled` keeping all models and interfaces working (falling back to standard (clean) json.Unmarshal).
type Enabled ¶
type Enabled struct {
// contains filtered or unexported fields
}
Enabled is a struct atom that enables dirty unmarshalling for the struct where it's embedded.
type Integer ¶
type Integer int64
Integer means an Integer number.
func (*Integer) UnmarshalJSON ¶
UnmarshalJSON converts []byte into an Integer.
type Number ¶
type Number float64
Number means any number (Integer, Float, Scientific, etc.)
func (*Number) UnmarshalJSON ¶
UnmarshalJSON converts []byte into a Number.
type Object ¶
Object is a JSON-like map (string->any).
func (*Object) UnmarshalJSON ¶
UnmarshalJSON converts []byte into an Object.
type Result ¶
type Result[D any] struct { // contains filtered or unexported fields }
Result stores the result of unmarshalling (as a filled Dirty model).
type String ¶
type String string
String means simply a string.
func (*String) UnmarshalJSON ¶
UnmarshalJSON converts []byte into a Bool.
type Time ¶
Time means a given moment within a day (day is not specified in the source value).
func (*Time) UnmarshalJSON ¶
UnmarshalJSON converts []byte into a Date.