Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Unpackable ¶
type Unpackable interface {
SetName(name string)
}
Unpackable instances provide the ability to assign their name using the attribute name of the enclosing JSON object
func Unpack ¶
func Unpack[F UnpackableFactory](b []byte, fact F) ([]Unpackable, error)
Unpack returns the slice of Unpackable instances within a JSON objects The Unpackable must be a pointer type implementation of the interface.
func UnpackAndValidate ¶
func UnpackAndValidate(b []byte, fact UnpackableFactory) ([]Unpackable, error)
UnpackAndValidate returns a validated set of Unpackables, where the validation to be performed is defined in the tag of each attribute see: https://pkg.go.dev/github.com/asaskevich/govalidator?utm_source=godoc
type UnpackableFactory ¶
type UnpackableFactory interface {
New() Unpackable
}
UnpackableFactory creates instances of Unpackable
Click to show internal directories.
Click to hide internal directories.