Documentation ¶
Index ¶
- func ExistsInArray(value string, arr []string) bool
- func FilterStructByFields(in interface{}, out interface{}, includedFields []string) (err error)
- func GetJSONToFieldsMap(structEntity interface{}) map[string]string
- func StructFieldMatchesValue(structEntity interface{}, field string, value interface{}) (matches bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExistsInArray ¶
ExistsInArray Returns true if value exists in arr, false otherwise
func FilterStructByFields ¶
FilterStructByFields Returns a copy of the same struct with only the includedFields, or the a copy if the fields passed are nil
func GetJSONToFieldsMap ¶
GetJSONToFieldsMap returns a map from JSON field to struct field name
func StructFieldMatchesValue ¶
func StructFieldMatchesValue(structEntity interface{}, field string, value interface{}) (matches bool, err error)
StructFieldMatchesValue Returns whether a struct entity's given field matches a certain value If it's an array, is returns whether the array's members are a subset of the field's array members else, they are compared by a == operator Returns true if value is nil Returns an error in case of errors in reflection or if values are of different types
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.