Documentation ¶
Index ¶
- Constants
- Variables
- func InitConfig(env string)
- func InitDB()
- func InitLogger()
- func Initialize()
- func LoggerMiddleware(logger *zap.Logger) gin.HandlerFunc
- func RecoveryMiddleware(logger *zap.Logger, stack bool) gin.HandlerFunc
- func SrvConnService()
- type Config
- type ConsulConfig
- type LogConfig
- type MysqlConfig
Constants ¶
View Source
const ( ResponseOK = 0 // 成功返回 ResponseErr = -1 //失败返回 GinContext = "ginContext" ServerName = "grpc-server" )
Variables ¶
View Source
var ( ServerConfig Config Logger *zap.Logger RpcConn proto.GreeterClient )
Functions ¶
func InitConfig ¶
func InitConfig(env string)
func InitLogger ¶
func InitLogger()
func Initialize ¶
func Initialize()
func LoggerMiddleware ¶
func LoggerMiddleware(logger *zap.Logger) gin.HandlerFunc
LoggerMiddleware for request
func RecoveryMiddleware ¶
func RecoveryMiddleware(logger *zap.Logger, stack bool) gin.HandlerFunc
func SrvConnService ¶
func SrvConnService()
Types ¶
type Config ¶
type Config struct { Db MysqlConfig `yaml:"db"` Log LogConfig `yaml:"log"` Consul ConsulConfig `yaml:"consul"` }
type ConsulConfig ¶
Click to show internal directories.
Click to hide internal directories.