Documentation ¶
Overview ¶
Package config is a package that parses configuration files into structures, and supports parsing yaml, json and toml files., code generated by https://github.com/liuzw3018/sponge.
Index ¶
- func Init(configFile string, fs ...func()) error
- func Set(conf *Config)
- func Show(hiddenFields ...string) string
- type App
- type Center
- type ClientSecure
- type ClientToken
- type Config
- type Consul
- type Etcd
- type Grpc
- type GrpcClient
- type HTTP
- type Jaeger
- type Logger
- type Mysql
- type Nacos
- type NacosRd
- type Redis
- type ServerSecure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { CacheType string `yaml:"cacheType" json:"cacheType"` EnableCircuitBreaker bool `yaml:"enableCircuitBreaker" json:"enableCircuitBreaker"` EnableHTTPProfile bool `yaml:"enableHTTPProfile" json:"enableHTTPProfile"` EnableLimit bool `yaml:"enableLimit" json:"enableLimit"` EnableMetrics bool `yaml:"enableMetrics" json:"enableMetrics"` EnableStat bool `yaml:"enableStat" json:"enableStat"` EnableTrace bool `yaml:"enableTrace" json:"enableTrace"` Env string `yaml:"env" json:"env"` Host string `yaml:"host" json:"host"` Name string `yaml:"name" json:"name"` RegistryDiscoveryType string `yaml:"registryDiscoveryType" json:"registryDiscoveryType"` TracingSamplingRate float64 `yaml:"tracingSamplingRate" json:"tracingSamplingRate"` Version string `yaml:"version" json:"version"` }
type ClientSecure ¶
type ClientToken ¶
type Config ¶
type Config struct { App App `yaml:"app" json:"app"` Consul Consul `yaml:"consul" json:"consul"` Etcd Etcd `yaml:"etcd" json:"etcd"` Grpc Grpc `yaml:"grpc" json:"grpc"` GrpcClient []GrpcClient `yaml:"grpcClient" json:"grpcClient"` HTTP HTTP `yaml:"http" json:"http"` Jaeger Jaeger `yaml:"jaeger" json:"jaeger"` Logger Logger `yaml:"logger" json:"logger"` Mysql Mysql `yaml:"mysql" json:"mysql"` NacosRd NacosRd `yaml:"nacosRd" json:"nacosRd"` Redis Redis `yaml:"redis" json:"redis"` }
type Grpc ¶
type Grpc struct { EnableToken bool `yaml:"enableToken" json:"enableToken"` HTTPPort int `yaml:"httpPort" json:"httpPort"` Port int `yaml:"port" json:"port"` ReadTimeout int `yaml:"readTimeout" json:"readTimeout"` ServerSecure ServerSecure `yaml:"serverSecure" json:"serverSecure"` WriteTimeout int `yaml:"writeTimeout" json:"writeTimeout"` }
type GrpcClient ¶
type GrpcClient struct { ClientSecure ClientSecure `yaml:"clientSecure" json:"clientSecure"` ClientToken ClientToken `yaml:"clientToken" json:"clientToken"` EnableLoadBalance bool `yaml:"enableLoadBalance" json:"enableLoadBalance"` Host string `yaml:"host" json:"host"` Name string `yaml:"name" json:"name"` Port int `yaml:"port" json:"port"` RegistryDiscoveryType string `yaml:"registryDiscoveryType" json:"registryDiscoveryType"` }
type Mysql ¶
type Mysql struct { ConnMaxLifetime int `yaml:"connMaxLifetime" json:"connMaxLifetime"` Dsn string `yaml:"dsn" json:"dsn"` EnableLog bool `yaml:"enableLog" json:"enableLog"` MastersDsn []string `yaml:"mastersDsn" json:"mastersDsn"` MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns"` MaxOpenConns int `yaml:"maxOpenConns" json:"maxOpenConns"` SlavesDsn []string `yaml:"slavesDsn" json:"slavesDsn"` SlowThreshold int `yaml:"slowThreshold" json:"slowThreshold"` }
type Nacos ¶
type Nacos struct { ContextPath string `yaml:"contextPath" json:"contextPath"` DataID string `yaml:"dataID" json:"dataID"` Format string `yaml:"format" json:"format"` Group string `yaml:"group" json:"group"` IPAddr string `yaml:"ipAddr" json:"ipAddr"` NamespaceID string `yaml:"namespaceID" json:"namespaceID"` Port int `yaml:"port" json:"port"` Scheme string `yaml:"scheme" json:"scheme"` }
Click to show internal directories.
Click to hide internal directories.