Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Conf = &Config{}
Conf @Description: 全局配置变量
Functions ¶
func LoadConfig ¶
LoadConfig @Description: 使用viper加载指定文件夹下的配置文件 @param confPath @return *viper.Viper @return error
func WatchConfig ¶
WatchConfig @Description: 监控配置文件变化并热加载程序 @param v
Types ¶
type AppConfig ¶
type AppConfig struct { Name string Version string Mode string PprofPort string URL string SSL bool CSRF bool Debug bool }
AppConfig @Description: 框架配置
type Config ¶
type Config struct { App AppConfig Http HttpConfig Grpc GrpcConfig Log LogConfig Mysql MysqlConfigs Redis RedisConfig Email EmailConfig Trace TraceConfig Jaeger JaegerConfig }
Config @Description: 全局配置
type EmailConfig ¶
type EmailConfig struct { Host string Port int Username string Password string Name string Address string ReplyTo string KeepAlive int }
EmailConfig @Description: 邮件配置
type GrpcConfig ¶
GrpcConfig @Description: grpc服务配置
type HttpConfig ¶
HttpConfig @Description: http服务配置
type JaegerConfig ¶
type JaegerConfig struct { SamplingServerURL string // Set the sampling server url SamplingType string // Set the sampling type SamplingParam float64 // Set the sampling parameter LocalAgentHostPort string // Set jaeger-agent's host:port that the reporter will used Gen128Bit bool // Generate 128 bit span IDs Propagation string // Which propagation format to use (jaeger/b3) TraceContextHeaderName string // Set the header to use for the trace-id CollectorEndpoint string // Instructs reporter to send spans to jaeger-collector at this URL CollectorUser string // CollectorUser for basic http authentication when sending spans to jaeger-collector CollectorPassword string // CollectorPassword for basic http authentication when sending spans to jaeger }
JaegerConfig @Description: 链路追踪Jaeger配置
type LogConfig ¶
type LogConfig struct { Name string Development bool DisableCaller bool DisableStacktrace bool Encoding string Level string Writers string FormatText bool RollingPolicy string RotateDate int RotateSize int BackupCount uint File string WarnFile string ErrorFile string }
LogConfig @Description: 日志配置文件
type MysqlConfig ¶
type MysqlConfig struct { Name string Addr string UserName string Password string ShowLog bool MaxIdleConn int MaxOpenConn int ConnMaxLifeTime time.Duration }
MysqlConfig @Description: mysql配置
type MysqlConfigs ¶
type MysqlConfigs map[string]MysqlConfig
type RedisConfig ¶
type RedisConfig struct { Addr string Password string DB int MinIdleConn int DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration PoolSize int PoolTimeout time.Duration }
RedisConfig @Description: redis 配置
type TraceConfig ¶
type TraceConfig struct { ServiceName string TraceAgent string // contains filtered or unexported fields }
TraceConfig @Description: 链路追踪配置
Click to show internal directories.
Click to hide internal directories.