Documentation ¶
Index ¶
- func CreatePlaceholder(length int) string
- func CreateSetConditions(data []SplitMap) string
- func GetRouteGroup(r *http.Request) string
- func IsValidEmail(email string) bool
- func LogJobMessage(format string, args ...interface{})
- func LogMessage(format string, args ...interface{})
- func Printer() *message
- func SliceToMap(cols []string, vals []interface{}) map[string]interface{}
- func StructSliceToMap(obj interface{}) []map[string]interface{}
- func StructToMap(obj interface{}) map[string]interface{}
- type RequestError
- type SplitMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePlaceholder ¶
Create placeholder string with the input "length" long (e.g. 1 returns $1, 2 returns $1, $2)
func CreateSetConditions ¶
Create "SET" conditions string with the input "data" Values are replaced with placeholders (e.g. []SplitMap{{"id", 1}, {"name", "John"}} returns "id = $1, name = $2") NB: To be used together with the MapToStructSlice function
func GetRouteGroup ¶
func IsValidEmail ¶
func LogJobMessage ¶
func LogJobMessage(format string, args ...interface{})
Logger to be used in the Jobs layer
func LogMessage ¶
func LogMessage(format string, args ...interface{})
func SliceToMap ¶
func StructSliceToMap ¶
func StructSliceToMap(obj interface{}) []map[string]interface{}
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
The struct - "obj", fields must have json tags
Types ¶
type RequestError ¶
func (*RequestError) Error ¶
func (r *RequestError) Error() string
func (*RequestError) StatusCode ¶
func (r *RequestError) StatusCode() int
type SplitMap ¶
type SplitMap struct { Key string Value interface{} }
func MapToStructSlice ¶
Split map[string]interface{} into []SplitMap (e.g map[string]interface{"id": 1, "name": "John"} returns []SplitMap{{"id", 1}, {"name", "John"}})
Click to show internal directories.
Click to hide internal directories.