Documentation ¶
Index ¶
- Constants
- Variables
- func GetAppName() string
- func GetDefaultGormDb() *gorm.DB
- func GetDefaultSugaredLogger() *zap.SugaredLogger
- func GetLocalIp() string
- func GetLogID(ctx *gin.Context) string
- func GetRequestID(ctx *gin.Context) string
- func InitConfig(config Config)
- func SetAppName(appName string)
- func SetDefaultGormDb(db *gorm.DB)
- func SetDefaultSugaredLogger(loger *zap.SugaredLogger)
- func SetKafkaClient(client IKafka)
- func SetLocalIp(localIp string)
- func SetRedisClient(client IRedis)
- type Config
- type DefaultRender
- type IKafka
- type IRedis
- type LogCtx
Constants ¶
View Source
const ( ContextKeyRequestID = "requestId" ContextKeyLogID = "logID" ContextKeyNoLog = "_no_log" )
util key
View Source
const ( TraceHeaderKey = "Uber-Trace-Id" LogIDHeaderKey = "X_BD_LOGID" LogIDHeaderKeyLower = "x_bd_logid" )
header key
Variables ¶
View Source
var ( DefaultSugaredLogger *zap.SugaredLogger AppName string LocalIp string )
View Source
var IgnoreDefaultDBLogFormat bool = false
View Source
var MysqlClient *gorm.DB
Functions ¶
func GetAppName ¶
func GetAppName() string
func GetDefaultGormDb ¶
func GetDefaultSugaredLogger ¶
func GetDefaultSugaredLogger() *zap.SugaredLogger
func GetLocalIp ¶
func GetLocalIp() string
func GetRequestID ¶
func InitConfig ¶ added in v1.10.2
func InitConfig(config Config)
Types ¶
type DefaultRender ¶
type IKafka ¶
type IKafka sarama.ConsumerGroup
var KafkaClient IKafka
func GetKafkaClient ¶
func GetKafkaClient() IKafka
Click to show internal directories.
Click to hide internal directories.