NewPublisher is a Publisher constructor
(exchange string, key string, opts ...PublisherOpt)
| 118 | |
| 119 | // NewPublisher is a Publisher constructor |
| 120 | func NewPublisher(exchange string, key string, opts ...PublisherOpt) *Publisher { |
| 121 | p := &Publisher{ |
| 122 | exchange: exchange, |
| 123 | key: key, |
| 124 | pubChan: make(chan publishMaybeErr), |
| 125 | stop: make(chan struct{}), |
| 126 | } |
| 127 | for _, o := range opts { |
| 128 | o(p) |
| 129 | } |
| 130 | return p |
| 131 | } |
| 132 | |
| 133 | // PublishingTemplate Publisher's functional option. Provide template |
| 134 | // amqp.Publishing and save typing. |
no outgoing calls