Documentation
¶
Index ¶
- Variables
- func DecodePayload(raw string, format Format) ([]byte, error)
- func DefaultCleaner(m map[string]any) map[string]any
- func Parse[T any](raw []byte, opts ...Option) (*T, error)
- func ParseByType(raw []byte, fieldPath string, reg Registry, opts ...Option) (any, error)
- func ParseInto(raw []byte, out any, opts ...Option) error
- func ParseMap(raw []byte, opts ...Option) (map[string]any, error)
- func Register(name string, ctor func() any)
- func ValidateStruct(v any, val *validator.Validate) error
- type Cleaner
- type Format
- type Option
- type Registry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTypeFieldRequired = errors.New("type field path is required") ErrTypeFieldNotFound = errors.New("type field not found") ErrTypeFieldNotStr = errors.New("type field is not a string") ErrNoRegistryEntry = errors.New("no registry entry for type") ErrUnsupportedFormat = errors.New("unsupported format") )
View Source
var DefaultRegistry = Registry{}
Functions ¶
func ParseByType ¶
Types ¶
type Option ¶
type Option func(*config)
func WithCleaner ¶
func WithFormat ¶
func WithValidation ¶
func WithValidator ¶
Click to show internal directories.
Click to hide internal directories.