doc.go 712 B

1234567891011121314151617181920212223
  1. /*
  2. Package protocol provides the low-level primitives necessary for communicating with a Kafka 0.8 cluster.
  3. The core of the package is the Broker. It represents a connection to a single Kafka broker service, and
  4. has methods for querying the broker.
  5. The other types are mostly Request types or Response types. Most of the Broker methods take a Request of a
  6. specific type and return a Response of the appropriate type, for example:
  7. broker := NewBroker("localhost", 9092)
  8. err := broker.Connect()
  9. if err != nil {
  10. return err
  11. }
  12. request := MetadataRequest{Topics:[]string{"myTopic"}}
  13. response, err := broker.GetMetadata("myClient", request)
  14. // do things with response
  15. broker.Close()
  16. */
  17. package protocol