structs

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package structs provides functions for struct conversion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapField

func MapField(pointer interface{}, priority []string, recursive bool) map[string]*Field

MapField retrieves struct field as map[name/tag]*Field from <pointer>, and returns it.

The parameter <recursive> specifies whether retrieving the struct field recursively.

Note that it only retrieves the exported attributes with first letter up-case from struct.

func TagMapField

func TagMapField(pointer interface{}, priority []string, recursive bool) map[string]*Field

TagMapField retrieves struct tags as map[tag]*Field from <pointer>, and returns it.

The parameter <recursive> specifies whether retrieving the struct field recursively.

Note that it only retrieves the exported attributes with first letter up-case from struct.

func TagMapName

func TagMapName(pointer interface{}, priority []string, recursive bool) map[string]string

TagMapName retrieves struct tags as map[tag]attribute from <pointer>, and returns it.

The parameter <recursive> specifies whether retrieving the struct field recursively.

Note that it only retrieves the exported attributes with first letter up-case from struct.

Types

type Field

type Field = structs.Field

Field is alias of structs.Field.

Jump to

Keyboard shortcuts

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