Documentation
¶
Index ¶
- func JSON(w http.ResponseWriter, statusCode int, data interface{})
- func MigrateDown(config Config, path string) error
- func MigrateSteps(steps int, config Config, path string) error
- func MigrateUp(config Config, path string) error
- func RandomInt(min, max int64) int64
- func RandomString(n int) string
- func StrToBinary(s string, base int) []byte
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSON ¶
func JSON(w http.ResponseWriter, statusCode int, data interface{})
JSON returns a well formated response with a status code
func MigrateDown ¶
func RandomString ¶
RandomString Generates a Random String of N characters
func StrToBinary ¶
Types ¶
type Config ¶
type Config struct {
DBUri string `mapstructure:"DB_URI" env:"DB_URI"`
SecretKey string `mapstructure:"SECRET_KEY" env:"SECRET_KEY"`
RedisPass string `mapstructure:"REDIS_PASS" env:"REDIS_PASS"`
RedisHost string `mapstructure:"REDIS_HOST" env:"REDIS_HOST"`
RedisDb int `mapstructure:"REDIS_DB" env:"REDIS_DB"`
MaxFileSize int64 `mapstructure:"MAX_FILE_SIZE" env:"MAX_FILE_SIZE"`
}
Config stores all configuration of the application
Click to show internal directories.
Click to hide internal directories.