Update options to be public. This means people can implement the interfaces and actually use the options
This commit is contained in:
@@ -22,7 +22,7 @@ type httpTransportClient struct {
|
||||
ht *httpTransport
|
||||
addr string
|
||||
conn net.Conn
|
||||
dialOpts dialOptions
|
||||
dialOpts DialOptions
|
||||
once sync.Once
|
||||
|
||||
sync.Mutex
|
||||
@@ -281,7 +281,7 @@ func (h *httpTransport) Dial(addr string, opts ...DialOption) (Client, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var dopts dialOptions
|
||||
var dopts DialOptions
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(&dopts)
|
||||
|
||||
@@ -29,22 +29,22 @@ type Transport interface {
|
||||
String() string
|
||||
}
|
||||
|
||||
type options struct{}
|
||||
type Options struct{}
|
||||
|
||||
type dialOptions struct {
|
||||
type DialOptions struct {
|
||||
stream bool
|
||||
}
|
||||
|
||||
type Option func(*options)
|
||||
type Option func(*Options)
|
||||
|
||||
type DialOption func(*dialOptions)
|
||||
type DialOption func(*DialOptions)
|
||||
|
||||
var (
|
||||
DefaultTransport Transport = newHttpTransport([]string{})
|
||||
)
|
||||
|
||||
func WithStream() DialOption {
|
||||
return func(o *dialOptions) {
|
||||
return func(o *DialOptions) {
|
||||
o.stream = true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user