MCPcopy
hub / github.com/segmentio/kafka-go / Broker

Method Broker

conn.go:240–249  ·  view source on GitHub ↗

Broker returns a Broker value representing the kafka broker that this connection was established to.

()

Source from the content-addressed store, hash-verified

238// Broker returns a Broker value representing the kafka broker that this
239// connection was established to.
240func (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.
252func (c *Conn) Controller() (broker Broker, err error) {

Callers

nothing calls this directly

Calls 3

splitHostPortNumberFunction · 0.85
RemoteAddrMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected