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

Method CreateTopics

createtopics.go:430–442  ·  view source on GitHub ↗

CreateTopics creates one topic per provided configuration with idempotent operational semantics. In other words, if CreateTopics is invoked with a configuration for an existing topic, it will have no effect.

(topics ...TopicConfig)

Source from the content-addressed store, hash-verified

428// operational semantics. In other words, if CreateTopics is invoked with a
429// configuration for an existing topic, it will have no effect.
430func (c *Conn) CreateTopics(topics ...TopicConfig) error {
431 requestV0Topics := make([]createTopicsRequestV0Topic, 0, len(topics))
432 for _, t := range topics {
433 requestV0Topics = append(
434 requestV0Topics,
435 t.toCreateTopicsRequestV0Topic())
436 }
437
438 _, err := c.createTopics(createTopicsRequest{
439 Topics: requestV0Topics,
440 })
441 return err
442}

Callers 8

testDeleteTopicsFunction · 0.45
TestConnCreateTopicsFunction · 0.45
TestClientCreateTopicsFunction · 0.45
clientCreateTopicFunction · 0.45
clientCreateTopicFunction · 0.45
newLocalClientAndTopicFunction · 0.45

Calls 2

createTopicsMethod · 0.95

Tested by 8

testDeleteTopicsFunction · 0.36
TestConnCreateTopicsFunction · 0.36
TestClientCreateTopicsFunction · 0.36
clientCreateTopicFunction · 0.36
clientCreateTopicFunction · 0.36
newLocalClientAndTopicFunction · 0.36