MCPcopy Create free account
hub / github.com/IBM/sarama / AddTopic

Method AddTopic

metadata_response.go:404–422  ·  view source on GitHub ↗
(topic string, err KError)

Source from the content-addressed store, hash-verified

402}
403
404func (r *MetadataResponse) AddTopic(topic string, err KError) *TopicMetadata {
405 var tmatch *TopicMetadata
406
407 for _, tm := range r.Topics {
408 if tm.Name == topic {
409 tmatch = tm
410 goto foundTopic
411 }
412 }
413
414 tmatch = new(TopicMetadata)
415 tmatch.Name = topic
416 r.Topics = append(r.Topics, tmatch)
417
418foundTopic:
419
420 tmatch.Err = err
421 return tmatch
422}
423
424func (r *MetadataResponse) AddTopicPartition(topic string, partition, brokerID int32, replicas, isr []int32, offline []int32, err KError) {
425 tmatch := r.AddTopic(topic, ErrNoError)

Calls

no outgoing calls