Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DBEngine *gorm.DB
View Source
var Logger log.Logger
View Source
var RedisEngine *redis.Client
View Source
var Tracer opentracing.Tracer
Functions ¶
func NewJaegerTracer ¶
Types ¶
type AppConfig ¶
type AppConfig struct { MySQL MySQLConfig `yaml:"mysql"` Redis RedisConfig `yaml:"redis"` Log LogConfig `yaml:"log"` JWT JWTConfig `yaml:"jwt"` HTTP HttpConfig `yaml:"http"` TraceAgent string `yaml:"traceAgent"` }
var AppEngine AppConfig
type HttpConfig ¶
type LogConfig ¶
type LogConfig struct { FileName string `mapstructure:"file-name"` LogLevel string `mapstructure:"log-level"` MaxSize int `mapstructure:"max-size"` MaxBackup int `mapstructure:"max-backup"` MaxAge int `mapstructure:"max-age"` Compress bool `mapstructure:"compress"` Encoding string `mapstructure:"encoding"` Env string `mapstructure:"env"` }
type MySQLConfig ¶
type MySQLConfig struct { Host string `mapstructure:"host"` Port string `mapstructure:"port"` UserName string `mapstructure:"username"` PassWord string `mapstructure:"password"` DataBase string `mapstructure:"database"` Charset string `mapstructure:"charset"` MaxIdleConnections int `mapstructure:"max-idle-connections"` MaxOpenConnections int `mapstructure:"max-open-connections"` MaxConnectionLifeTime time.Duration `mapstructure:"max-connection-life-time"` LogLevel int `mapstructure:"log-level"` }
func (*MySQLConfig) AddFlags ¶
func (o *MySQLConfig) AddFlags(fs *pflag.FlagSet)
type RedisConfig ¶
type RedisConfig struct { Addr string `mapstructure:"addr"` UserName string `mapstructure:"username"` PassWord string `mapstructure:"password"` DB int `mapstructure:"db"` }
func (*RedisConfig) AddFlags ¶
func (o *RedisConfig) AddFlags(fs *pflag.FlagSet)
func (*RedisConfig) NewClient ¶
func (o *RedisConfig) NewClient() (*redis.Client, error)
Click to show internal directories.
Click to hide internal directories.