Documentation ¶
Index ¶
- Constants
- Variables
- func Atoi(s string) int
- func Atoi64(s string) (int64, error)
- func CheckErr(err error, msg ...interface{})
- func CheckMatchesRegexp(regexpStr string, str string)
- func CheckOk(ok bool, msg ...interface{})
- func DownloadUrlToFile(url, path string) (data []byte, err error)
- func DownloadUrlToFileIfNotExists(url, path string) (data []byte, err error)
- func GetJson(i interface{}) string
- func GetPathInt64Param(c *gin.Context, key string) int64
- func GetUrlContent(url string) (body []byte, err error)
- func InitDb(config Config) *runner.DB
- func InitEnvironment()
- func InitLogs(c Config)
- func InitPersistence()
- func IsFileExists(name string) bool
- func ParseForumDate(dateStr string) time.Time
- func ParseParamsGet(c *gin.Context, params interface{})
- func PrintJson(i interface{})
- func WriteJSONStatus(c *gin.Context, model interface{}, httpStatus int)
- type AppEnv
- type Config
- type DbEnv
- type ListDancerParams
- type PageParams
- type PageResponse
Constants ¶
View Source
const DefaultLimit = 20
DefaultLimit elements in page in paged requests
View Source
const MaxLimit = 200
MaxLimit max elements in page in paged requests
Variables ¶
View Source
var AnyLog *log.Logger
View Source
var CompLog *log.Logger
View Source
var CronLog *log.Logger
View Source
var DB *runner.DB
View Source
var GinLog *log.Logger
View Source
var MGO *mgo.Session
View Source
var RecLog *log.Logger
Functions ¶
func CheckErr ¶
func CheckErr(err error, msg ...interface{})
CheckErr check error is nil and if not panic with message
func CheckMatchesRegexp ¶
func DownloadUrlToFile ¶
func GetPathInt64Param ¶
GetPathInt64Param returns path param with key
func GetUrlContent ¶
func InitEnvironment ¶
func InitEnvironment()
Устанавливает переменные окружения, заданные в local.env
func InitPersistence ¶
func InitPersistence()
func IsFileExists ¶
func ParseParamsGet ¶
func WriteJSONStatus ¶
Types ¶
type DbEnv ¶
type DbEnv struct { URL string `envconfig:"HUSTLEDB_DB_URL"` MaxIdleConns int `envconfig:"HUSTLEDB_DB_MAX_IDLE_CONNS" default:"4"` MaxOpenConns int `envconfig:"HUSTLEDB_DB_MAX_OPEN_CONNS" default:"16"` StrictMode bool `envconfig:"HUSTLEDB_DB_STRICT_MODE" default:"false"` MongoURL string `envconfig:"HUSTLEDB_MONGO_URL"` }
DbEnv db settings
type ListDancerParams ¶
type ListDancerParams struct { Offset int `json:"offset" form:"offset"` Limit int `json:"limit" form:"limit"` Query string `form:"query"` }
func (*ListDancerParams) Fix ¶
func (pp *ListDancerParams) Fix()
type PageParams ¶
type PageParams struct { Offset int `json:"offset" form:"offset"` Limit int `json:"limit" form:"limit"` }
func (*PageParams) Fix ¶
func (pp *PageParams) Fix()
type PageResponse ¶
Click to show internal directories.
Click to hide internal directories.