gsf

package module
v0.0.0-...-2b74f30 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: MIT Imports: 8 Imported by: 4

README

go-struct-filler

Build Status License

Convert or fill a struct for Go

v0.3.3 status

The exported functions could change at any time before the first stable release(>=1.0.0).

Overview

  • Convert a struct to another same type struct
  • Fill the same names if the struct is anonymous
  • Convert a map to struct
  • Convert a struct to slice or map

Installation

go get -u github.com/WindomZ/go-struct-filler

TODO

  • Support for more types
  • Provide better extension

LICENSE

MIT (http://opensource.org/licenses/mit-license.php)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStruct

func ConvertStruct(src, dest interface{}) error

func CopyStruct

func CopyStruct(src, dst interface{}) error

func FillStruct

func FillStruct(dest interface{}) error

func MapStruct

func MapStruct(m map[string]interface{}, dst interface{}) error

func MapToStruct

func MapToStruct(m map[string]interface{}, dst interface{}) error

func StructToStringMap

func StructToStringMap(src interface{}, tags ...string) (result map[string]string, err error)

func StructToStringSlice

func StructToStringSlice(src interface{}) (result []string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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