MCPcopy
hub / github.com/segmentio/kafka-go / newLocalClientWithTopic

Function newLocalClientWithTopic

client_test.go:23–35  ·  view source on GitHub ↗
(topic string, partitions int)

Source from the content-addressed store, hash-verified

21}
22
23func newLocalClientWithTopic(topic string, partitions int) (*Client, func()) {
24 client, shutdown := newLocalClient()
25 if err := clientCreateTopic(client, topic, partitions); err != nil {
26 shutdown()
27 panic(err)
28 }
29 return client, func() {
30 client.DeleteTopics(context.Background(), &DeleteTopicsRequest{
31 Topics: []string{topic},
32 })
33 shutdown()
34 }
35}
36
37func clientCreateTopic(client *Client, topic string, partitions int) error {
38 _, err := client.CreateTopics(context.Background(), &CreateTopicsRequest{

Calls 3

newLocalClientFunction · 0.70
clientCreateTopicFunction · 0.70
DeleteTopicsMethod · 0.45

Tested by

no test coverage detected