Documentation
¶
Index ¶
- func CallFunctionWithRows(fn interface{}, rows []map[string]interface{}) error
- func FillSliceWith(entities interface{}, dbRows []map[string]interface{}) error
- func FillStructWith(record interface{}, dbRow map[string]interface{}) error
- func StructToMap(obj interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallFunctionWithRows ¶
CallFunctionWithRows was created for helping test the QueryChunks method
func FillSliceWith ¶
FillSliceWith is meant to be used on unit tests to mock the response from the database.
The first argument is any slice of structs you are passing to a ksql func, and the second is a slice of maps representing the database rows you want to use to update this struct.
func FillStructWith ¶
FillStructWith is meant to be used on unit tests to mock the response from the database.
The first argument is any struct you are passing to a ksql func, and the second is a map representing a database row you want to use to update this struct.
func StructToMap ¶
StructToMap converts any struct type to a map based on the tag named `ksql`, i.e. `ksql:"map_key_name"`
Valid pointers are dereferenced and copied to the map, null pointers are ignored.
This function is efficient in the fact that it caches the slower steps of the reflection required to perform this task.
Types ¶
This section is empty.