(topic string, err KError)
| 402 | } |
| 403 | |
| 404 | func (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 | |
| 418 | foundTopic: |
| 419 | |
| 420 | tmatch.Err = err |
| 421 | return tmatch |
| 422 | } |
| 423 | |
| 424 | func (r *MetadataResponse) AddTopicPartition(topic string, partition, brokerID int32, replicas, isr []int32, offline []int32, err KError) { |
| 425 | tmatch := r.AddTopic(topic, ErrNoError) |
no outgoing calls