mapping

package
v1.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 16 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedType = errors.New("only map-like configs are suported")
)

Functions

func Deref

func Deref(t reflect.Type) reflect.Type

func Repr

func Repr(v interface{}) string

func UnmarshalJsonBytes

func UnmarshalJsonBytes(content []byte, v interface{}) error

func UnmarshalJsonReader

func UnmarshalJsonReader(reader io.Reader, v interface{}) error

func UnmarshalKey

func UnmarshalKey(m map[string]interface{}, v interface{}) error

func UnmarshalYamlBytes

func UnmarshalYamlBytes(content []byte, v interface{}) error

func UnmarshalYamlReader

func UnmarshalYamlReader(reader io.Reader, v interface{}) error

func ValidatePtr

func ValidatePtr(v *reflect.Value) error

Types

type MapValuer

type MapValuer map[string]interface{}

func (MapValuer) Value

func (mv MapValuer) Value(key string) (interface{}, bool)

type UnmarshalOption

type UnmarshalOption func(*unmarshalOptions)

func WithStringValues

func WithStringValues() UnmarshalOption

type Unmarshaler

type Unmarshaler struct {
	// contains filtered or unexported fields
}

func NewUnmarshaler

func NewUnmarshaler(key string, opts ...UnmarshalOption) *Unmarshaler

func (*Unmarshaler) Unmarshal

func (u *Unmarshaler) Unmarshal(m map[string]interface{}, v interface{}) error

func (*Unmarshaler) UnmarshalValuer

func (u *Unmarshaler) UnmarshalValuer(m Valuer, v interface{}) error

type Valuer

type Valuer interface {
	Value(key string) (interface{}, bool)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL