Browse Source

small fixes

pull/127/head
WiRight 3 years ago
parent
commit
d00549cbce
No known key found for this signature in database GPG Key ID: 427DBE0B77ED3FBD
1 changed files with 16 additions and 4 deletions
  1. +16
    -4
      declare.go

+ 16
- 4
declare.go View File

@ -31,12 +31,24 @@ func (d *Declarator) Close() {
d.chanManager.Close()
}
func (d *Declarator) DeclareExchange(options ExchangeOptions) error {
return declareExchange(d.chanManager, options)
func (d *Declarator) DeclareExchange(optionFuncs ...func(*PublisherOptions)) error {
defaultOptions := getDefaultPublisherOptions()
options := &defaultOptions
for _, optionFunc := range optionFuncs {
optionFunc(options)
}
return declareExchange(d.chanManager, options.ExchangeOptions)
}
func (d *Declarator) DeclareQueue(options QueueOptions) error {
return declareQueue(d.chanManager, options)
func (d *Declarator) DeclareQueue(queue string, optionFuncs ...func(*ConsumerOptions)) error {
defaultOptions := getDefaultConsumerOptions(queue)
options := &defaultOptions
for _, optionFunc := range optionFuncs {
optionFunc(options)
}
return declareQueue(d.chanManager, options.QueueOptions)
}
func (d *Declarator) BindExchanges(bindings []ExchangeBinding) error {


Loading…
Cancel
Save