Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StructTags ¶
StructTags is a map that stores a slice of tags related to each field in a struct.
func Extract ¶
func Extract(str any) StructTags
Extract accept a struct (or a pointer to a struct) and returns a map of fields and their tags.
func (StructTags) Filter ¶
func (m StructTags) Filter(tag string) StructTags
Filter returns a map of fields and their tags, if a field has given tag.
func (StructTags) FilterFunc ¶
func (m StructTags) FilterFunc(fn func(string, Tags) bool) StructTags
FilterFunc returns a map of fields and associated tags for given tag keys. fn is called for each field to decide whether that field should be included or not.
func (StructTags) FilterMany ¶
func (m StructTags) FilterMany(tags ...string) StructTags
FilterMany returns a map of fields and associated tags for given tag keys. If no tags are passed, nil is returned.
Click to show internal directories.
Click to hide internal directories.