Documentation ¶
Index ¶
- func InitConfigFromConsul(path string) error
- func InitConfigFromEtcd(path string) error
- func InitConfigFromLocal(path string) error
- func InitConfigFromNacos(path string) error
- type BizConfig
- type Config
- type ConfigSource
- type ConsumerConfig
- type Global
- type GlobalConfig
- type Hertz
- type Kafka
- type LocalConfigSource
- type Log
- type MongoConfig
- type MySQL
- type MySQLConfig
- type ProducerConfig
- type Prometheus
- type RedisConfig
- type Registry
- type Selector
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfigFromConsul ¶
func InitConfigFromEtcd ¶
func InitConfigFromLocal ¶
func InitConfigFromNacos ¶
Types ¶
type ConfigSource ¶
type ConfigSource interface { Load(path string) (*GlobalConfig, error) Watch() (<-chan *GlobalConfig, error) Close() error }
type ConsumerConfig ¶
type ConsumerConfig struct { Key string `yaml:"key"` Address []string `yaml:"address"` Group string `yaml:"group"` Topic string `yaml:"topic"` Partition int `yaml:"partition"` Offset int64 `yaml:"offset"` SaslConfig *kafka.SaslConfig `yaml:"sasl_config"` TlsConfig *kafka.TlsConfig `yaml:"tls_config"` }
type GlobalConfig ¶
type GlobalConfig struct { Global *Global `yaml:"global"` // Global config BizConfig *BizConfig `yaml:"biz_config"` // Biz config Hertz *Hertz `yaml:"hertz"` // Hertz Server config Log *Log `yaml:"log"` // Log config Registry *Registry `yaml:"registry"` // Registry center config Selector *Selector `yaml:"selector"` // Selector config Config *Config `yaml:"config"` // Config center config Prometheus *Prometheus `yaml:"prometheus"` // Prometheus config Kafka *Kafka `yaml:"kafka"` // Kafka config MySQL map[string]*MySQLConfig `yaml:"mysql"` // MySQL config Redis map[string]*RedisConfig `yaml:"redis"` // Redis config Mongo *MongoConfig `yaml:"mongo"` // Mongo config Minio *minio.Config `yaml:"minio"` // Minio config }
var (
GlobalStaticConfig *GlobalConfig
)
func GetGlobalStaticConfig ¶
func GetGlobalStaticConfig() *GlobalConfig
type Hertz ¶
type Hertz struct { App string `yaml:"app"` Server string `yaml:"server"` BinPath string `yaml:"bin_path"` ConfPath string `yaml:"conf_path"` DataPath string `yaml:"data_path"` EnablePprof bool `yaml:"enable_pprof"` EnableGzip bool `yaml:"enable_gzip"` EnableAccessLog bool `yaml:"enable_access_log"` Service []Service `yaml:"service"` }
type Kafka ¶
type Kafka struct { Producer []*ProducerConfig `yaml:"producer"` Consumer []*ConsumerConfig `yaml:"consumer"` }
type LocalConfigSource ¶
type LocalConfigSource struct {
// contains filtered or unexported fields
}
func NewLocalConfigSource ¶
func NewLocalConfigSource() *LocalConfigSource
func (*LocalConfigSource) Close ¶
func (l *LocalConfigSource) Close() error
func (*LocalConfigSource) Load ¶
func (l *LocalConfigSource) Load(path string) (*GlobalConfig, error)
func (*LocalConfigSource) Watch ¶
func (l *LocalConfigSource) Watch() (<-chan *GlobalConfig, error)
type MongoConfig ¶
type MySQL ¶
type MySQL struct { Host string `yaml:"host"` Port int `yaml:"port"` Username string `yaml:"username"` Password string `yaml:"password"` Database string `yaml:"database"` MultiStatements int `yaml:"multi_statements"` Charset string `yaml:"charset"` MaxOpenConns int `yaml:"max_open_conns"` MaxIdleConns int `yaml:"max_idle_conns"` }
type MySQLConfig ¶
type ProducerConfig ¶
type ProducerConfig struct { Key string `yaml:"key"` Address []string `yaml:"address"` Async bool `yaml:"async"` Topic string `yaml:"topic"` Ack int `yaml:"ack"` CompressCodec string `yaml:"compress_codec"` SaslConfig *kafka.SaslConfig `yaml:"sasl_config"` TlsConfig *kafka.TlsConfig `yaml:"tls_config"` }
type Prometheus ¶
type RedisConfig ¶
Click to show internal directories.
Click to hide internal directories.