Add Exchange option

This commit is contained in:
Asim Aslam
2019-02-23 10:50:53 +00:00
parent 7db2912d90
commit 58adaef339
2 changed files with 24 additions and 2 deletions

View File

@@ -65,6 +65,8 @@ type CallOptions struct {
}
type PublishOptions struct {
// Exchange is the routing exchange for the message
Exchange string
// Other options for implementations of the interface
// can be stored in a context
Context context.Context
@@ -236,6 +238,13 @@ func DialTimeout(d time.Duration) Option {
// Call Options
// WithExchange sets the exchange to route a message through
func WithExchange(e string) PublishOption {
return func(o *PublishOptions) {
o.Exchange = e
}
}
// WithAddress sets the remote address to use rather than using service discovery
func WithAddress(a string) CallOption {
return func(o *CallOptions) {