DialPartition opens a connection to the leader of the partition specified by partition descriptor. It's strongly advised to use descriptor of the partition that comes out of functions LookupPartition or LookupPartitions.
(ctx context.Context, network string, address string, partition Partition)
| 141 | // descriptor. It's strongly advised to use descriptor of the partition that comes out of |
| 142 | // functions LookupPartition or LookupPartitions. |
| 143 | func (d *Dialer) DialPartition(ctx context.Context, network string, address string, partition Partition) (*Conn, error) { |
| 144 | return d.connect(ctx, network, net.JoinHostPort(partition.Leader.Host, strconv.Itoa(partition.Leader.Port)), ConnConfig{ |
| 145 | ClientID: d.ClientID, |
| 146 | Topic: partition.Topic, |
| 147 | Partition: partition.ID, |
| 148 | Broker: partition.Leader.ID, |
| 149 | Rack: partition.Leader.Rack, |
| 150 | TransactionalID: d.TransactionalID, |
| 151 | }) |
| 152 | } |
| 153 | |
| 154 | // LookupLeader searches for the kafka broker that is the leader of the |
| 155 | // partition for a given topic, returning a Broker value representing it. |
no test coverage detected