Documentation ¶
Index ¶
- func Contains(list []string, str string) bool
- func Deref(t reflect.Type) reflect.Type
- func SetMapIndexValue(tp reflect.Type, value, key, target reflect.Value)
- func SetValue(tp reflect.Type, value, target reflect.Value)
- func TakeOne(valid, or string) string
- func UnmarshalJsonMap(m map[string]any, v any, opts ...UnmarshalOption) error
- func ValidatePtr(v *reflect.Value) error
- type UnmarshalOption
- type Unmarshaler
- type Valuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetMapIndexValue ¶
SetMapIndexValue sets target to value at key position, pointers are processed automatically.
func UnmarshalJsonMap ¶
func UnmarshalJsonMap(m map[string]any, v any, opts ...UnmarshalOption) error
UnmarshalJsonMap unmarshals content from m into v.
func ValidatePtr ¶
ValidatePtr validates v if it's a valid pointer.
Types ¶
type UnmarshalOption ¶
type UnmarshalOption func(*unmarshalOptions)
UnmarshalOption defines the method to customize an Unmarshaler.
func WithCanonicalKeyFunc ¶
func WithCanonicalKeyFunc(f func(string) string) UnmarshalOption
WithCanonicalKeyFunc customizes an Unmarshaler with Canonical Key func.
type Unmarshaler ¶
type Unmarshaler struct {
// contains filtered or unexported fields
}
Unmarshaler is used to unmarshal with given tag key.
func NewUnmarshaler ¶
func NewUnmarshaler(key string, opts ...UnmarshalOption) *Unmarshaler
NewUnmarshaler returns an Unmarshaler.
func (*Unmarshaler) Unmarshal ¶
func (u *Unmarshaler) Unmarshal(i any, v any) error
Unmarshal unmarshals m into v.
func (*Unmarshaler) UnmarshalValuer ¶
func (u *Unmarshaler) UnmarshalValuer(m Valuer, v any) error
UnmarshalValuer unmarshals m into v.
Click to show internal directories.
Click to hide internal directories.