client: add proxy option (#1885)

* client: add proxy option

* client: add WithProxy CallOption

* use address option

* ProxyAddress => Proxy
This commit is contained in:
ben-toogood
2020-07-30 15:22:36 +01:00
committed by GitHub
parent 006bbefaf3
commit e9fc5b1671
6 changed files with 35 additions and 88 deletions

View File

@@ -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) {