This commit is contained in:
bense
2024-10-13 17:14:07 +08:00
parent ddff662722
commit ec3af8aaea
6 changed files with 15 additions and 25 deletions

View File

@@ -6,8 +6,9 @@ const (
)
type Options struct {
TCPAddress string // 服务器地址
MaxRetryTimes int // 重试次数
TCPAddress string // 服务器地址
TCPAddressPool []string // 服务器地址池
MaxRetryTimes int // 重试次数
}
func defaultOptions() *Options {
@@ -32,3 +33,9 @@ func WithTCPAddress(tcpAddress string) Option {
o.TCPAddress = tcpAddress
}
}
func WithTCPAddressPool(ips ...string) Option {
return func(o *Options) {
o.TCPAddressPool = ips
}
}