Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadGlobalConfig ¶
func SetGlobalConfig ¶
func SetGlobalConfig(cfg *Config)
Types ¶
type BackendConfig ¶
type BackendConfig struct {
ServiceName string `yaml:"name"` // service name
Target string `yaml:"target"` // dsn or other
Network string `yaml:"network"` // tcp/udp
Protocol string `yaml:"protocol"` // tars/http
Namespace string `yaml:"namespace"` // namespace
Timeout int `yaml:"timeout"` // Timeout in milliseconds.
}
func GetClientConfig ¶
func GetClientConfig(serviceName string) *BackendConfig
func (*BackendConfig) String ¶
func (c *BackendConfig) String() string
type ClientConfig ¶
type ClientConfig struct {
Network string `yaml:"network"` // Network for all backends. Default is tcp.
Protocol string `yaml:"protocol"` // Protocol for all backends. Default is trpc.
Namespace string `yaml:"namespace"` // Namespace for all backends.
Timeout int `yaml:"timeout"` // Timeout in milliseconds.
Service []*BackendConfig `yaml:"service"` // Configuration for each individual backend.
}
type Config ¶
type Config struct {
Global struct {
Namespace string `yaml:"namespace"`
EnvName string `yaml:"env_name"`
}
Client ClientConfig `yaml:"client"`
}
func GlobalConfig ¶
func GlobalConfig() *Config
func LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.