mapconv

package
v2.0.0-beta7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFrom

func ConvertFrom(source interface{}, dest interface{}) error

ConvertFrom converts struct which input by mapconv from plain models

func ConvertTo

func ConvertTo(source interface{}, dest interface{}) error

ConvertTo converts struct which input by mapconv to plain models

Types

type Map

type Map map[string]interface{}

Map is wrapper of map[string]interface{}

func (*Map) Get

func (m *Map) Get(key string) (interface{}, error)

Get returns map value with dot-separated key

func (*Map) Map

func (m *Map) Map() map[string]interface{}

Map returns output map

func (*Map) Set

func (m *Map) Set(key string, value interface{})

Set sets map value with dot-separated key

type TagInfo

type TagInfo struct {
	SourceFields []string
	DefaultValue interface{}
	OmitEmpty    bool
	Recursive    bool
	Squash       bool
	IsSlice      bool
}

TagInfo mapconvタグの情報

func ParseMapConvTag

func ParseMapConvTag(tagBody string) TagInfo

ParseMapConvTag mapconvタグを文字列で受け取りパースしてTagInfoを返す

Jump to

Keyboard shortcuts

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