Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTagsFromStruct ¶
ExtractTagsFromStruct returns list of tag values
func StructToMapByTags ¶
StructToMapByTags shortcut to Reflector.ExtractValues
Types ¶
type ExtractOption ¶
type ExtractOption interface {
Apply(extractConfig) extractConfig
}
ExtractOption an option for Reflector.ExtractValues and Reflector.ExtractTags.
func WithoutEmbedded ¶
func WithoutEmbedded() ExtractOption
WithoutEmbedded skip embedded structures.
func WithoutMinus ¶
func WithoutMinus() ExtractOption
WithoutMinus skip fields with tag setted to minus sign.
type Reflector ¶
type Reflector struct {
// contains filtered or unexported fields
}
Reflector of structure.
func (Reflector) ExtractTags ¶
func (r Reflector) ExtractTags(tagName string, opts ...ExtractOption) map[string]string
ExtractTags returns hash-map which field value refer to tag value
func (Reflector) ExtractValues ¶
func (r Reflector) ExtractValues(tagName string, skipNils bool, opts ...ExtractOption) map[string]interface{}
ExtractValues returns hash-map which tag value refer to field value.
Click to show internal directories.
Click to hide internal directories.