(_ context.Context, dt driver.Topic, testName string)
| 133 | } |
| 134 | |
| 135 | func (h *harness) CreateSubscription(_ context.Context, dt driver.Topic, testName string) (ds driver.Subscription, cleanup func(), err error) { |
| 136 | queue := fmt.Sprintf("%s-subscription-%d", testName, atomic.AddUint32(&h.numSubs, 1)) |
| 137 | if err := bindQueue(h.conn, queue, dt.(*topic).exchange); err != nil { |
| 138 | return nil, nil, err |
| 139 | } |
| 140 | cleanup = func() { |
| 141 | ch, err := h.conn.Channel() |
| 142 | if err != nil { |
| 143 | panic(err) |
| 144 | } |
| 145 | ch.QueueDelete(queue) |
| 146 | } |
| 147 | ds = newSubscription(h.conn, queue, nil) |
| 148 | return ds, cleanup, nil |
| 149 | } |
| 150 | |
| 151 | func (h *harness) MakeNonexistentSubscription(_ context.Context) (driver.Subscription, func(), error) { |
| 152 | return newSubscription(h.conn, "nonexistent-subscription", nil), func() {}, nil |
no test coverage detected