map2struct

package
v0.0.0-...-517d9f4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package map2struct Time : 2022/8/14 09:22 Author : xushiyin contact : yuqingxushiyin@gmail.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Family

type Family struct {
	LastName string `mapstructure:"LastName"`
}

type Location

type Location struct {
	City string `mapstructure:"City"`
}

type Person

type Person struct {
	Name   string
	Age    int
	Emails []string
	Extra  map[string]string
}

func PersonMap2Struct

func PersonMap2Struct(input interface{}) (*Person, error)

func PersonMap2StructWeak

func PersonMap2StructWeak(input interface{}) (*Person, error)

func (Person) String

func (p Person) String() string

type Person2

type Person2 struct {
	Family    `mapstructure:"Family,squash"`
	Location  `mapstructure:"Location,squash"`
	FirstName string `mapstructure:"FirstName"`
}

func Person2Map2StructSquash

func Person2Map2StructSquash(input interface{}) (*Person2, error)

func (Person2) String

func (p Person2) String() string

type Person3

type Person3 struct {
	Name string
	Age  int
}

func Person3Map2StructConf

func Person3Map2StructConf(input interface{}) (*Person3, error)

func (Person3) String

func (p Person3) String() string

Jump to

Keyboard shortcuts

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