Add wrapper implementation

This commit is contained in:
Asim
2015-11-26 20:36:42 +00:00
parent 4fa909a3c7
commit fb172df0ce
4 changed files with 144 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ type options struct {
broker broker.Broker
registry registry.Registry
transport transport.Transport
wrappers []Wrapper
}
// Broker to be used for pub/sub
@@ -48,3 +49,10 @@ func Transport(t transport.Transport) Option {
o.transport = t
}
}
// Adds a Wrapper to a list of options passed into the client
func Wrap(w Wrapper) Option {
return func(o *options) {
o.wrappers = append(o.wrappers, w)
}
}