Documentation ¶
Index ¶
- Constants
- Variables
- func GAddr() string
- func GetConfigByClient(target, name string) (ret string)
- func GetConfigPath() string
- func GetRVal(name string) string
- func GetRValMap(name string) (vmap map[string]string)
- func GetVFromValMap(name, k string) string
- func SetGConfig(cfg *GlobalConfig)
- type Client
- type GlobalConfig
- type Grconf
Constants ¶
View Source
const (
Gconf = "gconf"
)
View Source
const (
NamespaceProd = "prod" // 正式环境namespace配置
)
Variables ¶
View Source
var (
ConfigPath = defaultPath
)
Functions ¶
func GetConfigByClient ¶
func GetConfigPath ¶
func GetConfigPath() string
func GetRValMap ¶
func GetVFromValMap ¶
func SetGConfig ¶
func SetGConfig(cfg *GlobalConfig)
Types ¶
type Client ¶
type Client struct { Name string `json:"name"` Target string `json:"target"` Network string `json:"network"` Timeout int64 `json:"timeout"` Config map[string]string `json:"config"` }
func GConfByClientName ¶
type GlobalConfig ¶
type GlobalConfig struct { Global struct { Namespace string `json:"namespace"` EnvName string `json:"env_name"` } `json:"global"` Server struct { App string `json:"app"` Ip string `json:"ip"` Port string `json:"port"` Limit int `json:"limit"` Timeout int `json:"timeout"` } `json:"server"` Client []Client `json:"client"` }
func GConfig ¶
func GConfig() *GlobalConfig
func LoadConfig ¶
func LoadConfig(path string) *GlobalConfig
Click to show internal directories.
Click to hide internal directories.