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)
| 428 | // operational semantics. In other words, if CreateTopics is invoked with a |
| 429 | // configuration for an existing topic, it will have no effect. |
| 430 | func (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 | } |