Documentation ¶
Overview ¶
Package config provide confg file read and unmarshal
Index ¶
Constants ¶
View Source
const EnvConfigEnv = "ENV_CONFIG_ENV"
EnvConfigEnv 配置文件环境
View Source
const EnvConfigFile = "ENV_CONFIG_FILE"
EnvConfigFile 配置文件环境变量名称
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct { DSN string `mapstructure:"dsn"` Host string `mapstructure:"host"` Port uint16 `mapstructure:"port"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` DbName string `mapstructure:"db_name"` Charset string `mapstructure:"charset"` Timezone string `mapstructure:"timezone"` MaxIdleConns int `mapstructure:"max_idle_conns"` MaxOpenConns int `mapstructure:"max_open_conns"` ConnMaxLifeTime int `mapstructure:"conn_max_life_time"` }
type Nacos ¶
type Nacos struct { DataID string `mapstructure:"data_id"` Group string `mapstructure:"group"` Client NacosClient `mapstructure:"client"` Server []NacosServer `mapstructure:"server"` }
Nacos 配置
type NacosClient ¶
type NacosClient struct { NamespaceID string `mapstructure:"namespace_id"` AccessKey string `mapstructure:"access_key"` SecretKey string `mapstructure:"secret_key"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` NotLoadCacheAtStart bool `mapstructure:"not_load_cache_at_start"` LogLevel string `mapstructure:"log_level"` }
type NacosServer ¶
type Otel ¶
type Otel struct {
TraceExporterURL string `mapstructure:"trace_exporter_url"`
}
Otel opentelemetry配置
Click to show internal directories.
Click to hide internal directories.