Broker returns a Broker value representing the kafka broker that this connection was established to.
()
| 238 | // Broker returns a Broker value representing the kafka broker that this |
| 239 | // connection was established to. |
| 240 | func (c *Conn) Broker() Broker { |
| 241 | addr := c.conn.RemoteAddr() |
| 242 | host, port, _ := splitHostPortNumber(addr.String()) |
| 243 | return Broker{ |
| 244 | Host: host, |
| 245 | Port: port, |
| 246 | ID: int(c.broker), |
| 247 | Rack: c.rack, |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | // Controller requests kafka for the current controller and returns its URL. |
| 252 | func (c *Conn) Controller() (broker Broker, err error) { |
nothing calls this directly
no test coverage detected