mapping

package
v1.10.35 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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