MCPcopy
hub / github.com/IBM/sarama / AddTopic

Method AddTopic

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

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls