client: add proxy option (#1885)
* client: add proxy option * client: add WithProxy CallOption * use address option * ProxyAddress => Proxy
This commit is contained in:
@@ -17,6 +17,8 @@ import (
|
||||
type Options struct {
|
||||
// Used to select codec
|
||||
ContentType string
|
||||
// Proxy address to send requests via
|
||||
Proxy string
|
||||
|
||||
// Plugged interfaces
|
||||
Broker broker.Broker
|
||||
@@ -149,6 +151,13 @@ func ContentType(ct string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Proxy sets the proxy address
|
||||
func Proxy(addr string) Option {
|
||||
return func(o *Options) {
|
||||
o.Proxy = addr
|
||||
}
|
||||
}
|
||||
|
||||
// PoolSize sets the connection pool size
|
||||
func PoolSize(d int) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
Reference in New Issue
Block a user