Documentation ¶
Index ¶
- func BatchInsertQuery(tableName string, rowCount int, colCount int, cols ...[]string) string
- func GetDuration(duration string) (seconds int)
- func GetMapKey(m map[int]string, value string) int
- func GetQuery(r *http.Request, key string, defaultValue ...string) string
- func GetValueFromSplit(str string, separator string, index int) string
- func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, ...)
- func SecondToString(seconds int) string
- func StrToNum(strNum string) int
- func UniqueInt(list []int) (unique []int)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchInsertQuery ¶
BatchInsertQuery to create raw batch insert query.
func GetDuration ¶
GetDuration to get duration in seconds. Example: "3 hr. 30 min. 20 sec." => 12620.
func GetValueFromSplit ¶
GetValueFromSplit to get value from splitted string. Will return empty string if out of index.
func ResponseWithJSON ¶
func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, meta ...map[string]interface{})
ResponseWithJSON to write response with JSON format.
func SecondToString ¶
SecondToString to convert int seconds to string duration. Example: 12620 => 03:30:20.
Types ¶
Click to show internal directories.
Click to hide internal directories.