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 ResponseWithJPEG(w http.ResponseWriter, image image.Image, code int, err error)
- func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, ...)
- func SecondToString(seconds int) string
- func StrToNum(strNum string) int
- func Thousands(num int) string
- 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 ResponseWithJPEG ¶ added in v0.4.2
ResponseWithJPEG to write response with JPEG format.
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.
func StrToNum ¶
StrToNum to convert string number to integer including comma removal (1,234 -> 1234).
Types ¶
Click to show internal directories.
Click to hide internal directories.