gconf

package
v0.0.0-...-e1c4844 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gconf = "gconf"
)
View Source
const (
	NamespaceProd = "prod" // 正式环境namespace配置
)

Variables

View Source
var (
	ConfigPath = defaultPath
)

Functions

func GAddr

func GAddr() string

func GetConfigByClient

func GetConfigByClient(target, name string) (ret string)

func GetConfigPath

func GetConfigPath() string

func GetRVal

func GetRVal(name string) string

func GetRValMap

func GetRValMap(name string) (vmap map[string]string)

func GetVFromValMap

func GetVFromValMap(name, k string) string

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

func GConfByClientName(name string) (cli Client)

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

type Grconf

type Grconf struct {
	Id   int32  `json:"id"`
	Env  string `json:"env_name"`
	Name string `json:"name"`
	App  string `json:"app"`
	Typ  int32  `json:"typ"`
	Val  string `json:"val"`
}

func GetGrconf

func GetGrconf(name string) *Grconf

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL