Add extra options to be used by others that need them

This commit is contained in:
Asim
2015-12-31 18:14:40 +00:00
parent 64b45f7846
commit 191e835aa9
5 changed files with 26 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ func (h *httpTransportClient) Send(m *Message) error {
func (h *httpTransportClient) Recv(m *Message) error {
var r *http.Request
if !h.dialOpts.stream {
if !h.dialOpts.Stream {
rc, ok := <-h.r
if !ok {
return io.EOF

View File

@@ -29,10 +29,16 @@ type Transport interface {
String() string
}
type Options struct{}
type Options struct {
// Other options to be used by broker implementations
Options map[string]string
}
type DialOptions struct {
stream bool
Stream bool
// Other options to be used by broker implementations
Options map[string]string
}
type Option func(*Options)
@@ -45,7 +51,7 @@ var (
func WithStream() DialOption {
return func(o *DialOptions) {
o.stream = true
o.Stream = true
}
}