Documentation
¶
Index ¶
- func FieldWithJsonTagValue(model interface{}, value string) (name string, ok bool)
- func GetFieldByName(structPtr interface{}, fieldName string) reflect.Value
- func InterfaceSlice(slice interface{}) []interface{}
- func IsBlank(s string) bool
- func LookupForStructFieldTag(model interface{}, field string, tagName string) (value string, ok bool)
- func StructValueAndType(model interface{}) (reflect.Value, reflect.Type)
- func ValuesForStructTag(model interface{}, tagName string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldWithJsonTagValue ¶
FieldWithJsonTagValue returns the first field with a specific JSON tag. It parses the JSON tag to match against the primary key in the json tag, unwinding custom json tag options. See documentation at https://golang.org/pkg/encoding/json/#Marshal
func GetFieldByName ¶
GetFieldByName gets the value of a field on the given structPtr.
func InterfaceSlice ¶
func InterfaceSlice(slice interface{}) []interface{}
InterfaceSlice takes an interface representing a known slice, and converts it into a []interface{}.
func LookupForStructFieldTag ¶
func LookupForStructFieldTag(model interface{}, field string, tagName string) (value string, ok bool)
LookupForStructFieldTag returns the string value associated with a field and tag in a model, if it exists.
func StructValueAndType ¶
StructValueAndType returns a the reflected value and type of a model.
func ValuesForStructTag ¶
ValuesForStructTag returns a list of string values associated with a tag in a model.
Types ¶
This section is empty.