(topic string, err KError)
| 406 | } |
| 407 | |
| 408 | func (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 | |
| 422 | foundTopic: |
| 423 | |
| 424 | tmatch.Err = err |
| 425 | return tmatch |
| 426 | } |
| 427 | |
| 428 | func (r *MetadataResponse) AddTopicPartition(topic string, partition, brokerID int32, replicas, isr []int32, offline []int32, err KError) { |
| 429 | tmatch := r.AddTopic(topic, ErrNoError) |
no outgoing calls