Documentation ¶
Index ¶
- func CreateDirIfNotExists(path string) error
- func ExistDir(path string) bool
- func GetDefaultLog(servicename string, requestID string) *logrus.Entry
- func Has(b, flag Bits) bool
- func IntInSlice(a int, list []int) bool
- func MigrateDB(db *sql.DB, migrationDir string) error
- func ParseFormCollection(r *http.Request, typeName string) []map[string]string
- func RandomString(count int) string
- func ReadConfig(cmd *cobra.Command, configName string, localConfigName string, ...) error
- func StringInSlice(a string, list []string) bool
- func StringInSliceI(a string, list []string) bool
- func TimeToString(t time.Time, lang string) string
- func ValidateRequestData(destStruct interface{}, log *logrus.Entry, c *gin.Context) bool
- type Bits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExists ¶
CreateDirIfNotExists creates an directory if it does not exists
func GetDefaultLog ¶
GetDefaultLog returns a default Log Entry to be used
func IntInSlice ¶
IntInSlice checks if a int is inside a slice
func MigrateDB ¶
MigrateDB migrates the database to the specified version migrate must be the only param for the binary only goose params may be attached to it
func ParseFormCollection ¶
ParseFormCollection - returns an array of maps e.g.form post Contacts[0][Name] = Alice Contacts[0][City] = Seattle Contacts[1][Name] = Bob Contacts[1][City] = Boston
func RandomString ¶
RandomString generates a random string of len count
func ReadConfig ¶
func ReadConfig(cmd *cobra.Command, configName string, localConfigName string, config interface{}) error
ReadConfig reads the config from the file and merges the local file if present config files must be in toml format
func StringInSlice ¶
StringInSlice checks if a string is inside a slice
func StringInSliceI ¶
StringInSliceI checks if a string is inside a slice (caseinsensitive)
func TimeToString ¶
TimeToString converts a time to a given language time-string