Documentation ¶
Overview ¶
启动
配置信息
mysql
日志
reids
Index ¶
- Constants
- Variables
- func CheckError(err error, errType string) error
- func ControlCors() gin.HandlerFunc
- func GetConfigByName(filename string) (configList map[string]interface{})
- func GetProjectName() string
- func Init()
- func InitLogger()
- func InitMysql()
- func InitRedis()
- func InitWeb(funs []gin.HandlerFunc) *gin.Engine
- func LogRecovery() gin.HandlerFunc
- func ProjectPath() (path string)
- func RunWeb(r *gin.Engine, addr string)
- func SetLogger() gin.HandlerFunc
- func SetProjectName(name string)
- func Usage()
- type Config
- type MysqlInstance
- type RedisClient
Constants ¶
View Source
const ( OnlineServiceHostPort = ":50051" HttpTimeoutHandler = 10 * time.Second //TimeoutHandler默认的http超时时间,http响应时间超过后直接返回client端503(不同项目可根据接口最大超时时间调整) EnvLocal = "local" EnvTest = "test" EnvBVT = "bvt" EnvProduct = "product" EnvBenchmark = "benchmark" )
环境参数
Variables ¶
View Source
var ( CoreCtx coreCtx DevEnv string TestConfig string ProjectName string )
变量
Functions ¶
func GetConfigByName ¶
GetConfigByName 通过名称解析yaml
Types ¶
type MysqlInstance ¶
MysqlInstance mysql对象
func GetMysqlInstance ¶
func GetMysqlInstance(dbName string) (MysqlInstance, error)
GetMysqlInstance 获取数据库连接
Click to show internal directories.
Click to hide internal directories.