Discover Packages
github.com/k2let/k2let
examples
config
package
Version:
v0.0.0-...-115e584
Opens a new window with list of versions in this module.
Published: Aug 6, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
用于从注册中心pull数据,和注册中心push数据到业务服务
LoadGlobalConfig 从配置文件加载配置,并设置到全局结构里面
RepairConfig 修复配置数据,填充默认值
func SetGlobalConfig(cfg *Config )
SetGlobalConfig 设置全局配置
type Broker struct {
MQ string `json:"mq"`
Exchange string `json:"exchange"`
Args []string `json:"args"`
}
type Config struct {
Tracing Tracing `json:"tracing"`
DB DB `json:"db"`
Redis Redis `json:"redis"`
FilerDSN string `json:"filer_dsn"`
Broker Broker `json:"broker"`
Server Server `json:"server"`
Region Region `json:"region"`
}
type DB struct {
UserName string `json:"username"`
Password string `json:"password"`
Host string `json:"host"`
Debug string `json:"debug"`
}
type FileProvider struct {
}
FileProvider 从文件系统中拉取文件内容
type Redis struct {
Host string `json:"host"`
Password string `json:"password"`
SentinelHost string `json:"sentinel_host"`
SentinelName string `json:"sentinel_name"`
}
type Region struct {
Name string `json:"name"`
}
type Server struct {
ServerName string `json:"server_name"`
}
type Tracing struct {
ReportAddr string `json:"report_addr"`
Level string `json:"level"`
}
Config 配置
Source Files
¶
Click to show internal directories.
Click to hide internal directories.