Documentation
¶
Index ¶
Constants ¶
View Source
const ConfigKey = "nats"
ConfigKey for this repo
Variables ¶
View Source
var Factory *tao.BaseFactory[*nats.Conn]
Factory manages all instances
View Source
var M = &Config{}
M config of nats
Functions ¶
Types ¶
type Config ¶
type Config struct {
tao.BaseMultiConfig[InstanceConfig]
RunAfters []string `json:"run_after,omitempty"`
}
Config is the total configuration, implements tao.MultiConfig interface
type InstanceConfig ¶
type InstanceConfig struct {
URL string `json:"url" yaml:"url"`
User string `json:"user,omitempty" yaml:"user,omitempty"`
Password string `json:"password,omitempty" yaml:"password,omitempty"`
Token string `json:"token,omitempty" yaml:"token,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Reconnect bool `json:"reconnect" yaml:"reconnect"`
MaxReconnect int `json:"max_reconnect" yaml:"max_reconnect"`
ReconnectWait time.Duration `json:"reconnect_wait" yaml:"reconnect_wait"`
Timeout time.Duration `json:"timeout" yaml:"timeout"`
}
InstanceConfig 单实例配置
Click to show internal directories.
Click to hide internal directories.