Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultDrainTimeout 默认超时时间 DefaultDrainTimeout = 300 // DefaultConnectTimeout 建立连接超时时间 DefaultConnectTimeout = 2 // DefaultReconnectWait 重连超时时间 DefaultReconnectWait = 2 // DefaultMaxReconnect 重试的次数 DefaultMaxReconnect = 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Servers []string `json:"servers,omitempty" yaml:"servers" toml:"servers" env:"NATS_SERVERS" envSeparator:"," validate:"required"` DrainTimeout int `json:"drain_timeout" yaml:"drain_timeout" toml:"drain_timeout" env:"NATS_DRAIN_TIMEOUT"` // 单位秒 ConnectTimeout int `json:"connect_timeout" yaml:"connect_timeout" toml:"connect_timeout" env:"NATS_CONNECT_TIMEOUT"` // 单位秒 ReconnectWait int `json:"reconnect_wait" ymal:"reconnect_wait" toml:"reconnect_wait" env:"NATS_RECONNECT_WAIT"` // 单位秒 MaxReconnect int `json:"max_reconnect" yaml:"max_reconnect" toml:"max_reconnect" env:"NATS_MAX_RECONNECT"` // 最大重连次数 Username string `json:"user_name" yaml:"user_name" toml:"user_name" env:"NATS_USERNAME"` // 用户名 Password string `json:"password" yaml:"password" toml:"password" env:"NATS_PASSWORD"` // 密码 Token string `json:"token" yaml:"token" toml:"token" env:"NATS_TOKEN"` // 连接Token }
Config 配置
func (*Config) GetConnectTimeout ¶
GetConnectTimeout todo
func (*Config) GetDrainTimeout ¶
GetDrainTimeout todo
func (*Config) GetReconnectWait ¶
GetReconnectWait todo
Click to show internal directories.
Click to hide internal directories.