(topic string, partitions int)
| 46 | } |
| 47 | |
| 48 | func newLocalClientWithTopic(topic string, partitions int) (*kafka.Client, func()) { |
| 49 | client, shutdown := newLocalClient() |
| 50 | if err := clientCreateTopic(client, topic, partitions); err != nil { |
| 51 | shutdown() |
| 52 | panic(err) |
| 53 | } |
| 54 | return client, func() { |
| 55 | client.DeleteTopics(context.Background(), &kafka.DeleteTopicsRequest{ |
| 56 | Topics: []string{topic}, |
| 57 | }) |
| 58 | shutdown() |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | func clientCreateTopic(client *kafka.Client, topic string, partitions int) error { |
| 63 | _, err := client.CreateTopics(context.Background(), &kafka.CreateTopicsRequest{ |
no test coverage detected