|
|
@@ -1,7 +1,6 @@
|
|
|
package kafka
|
|
|
|
|
|
// make []int32 sortable so we can sort partition numbers
|
|
|
-
|
|
|
type int32Slice []int32
|
|
|
|
|
|
func (slice int32Slice) Len() int {
|
|
|
@@ -32,3 +31,14 @@ func (s StringEncoder) Encode() ([]byte, error) {
|
|
|
type Encoder interface {
|
|
|
Encode() ([]byte, error)
|
|
|
}
|
|
|
+
|
|
|
+// create a message struct to return from high-level fetch requests
|
|
|
+// we could in theory use sarama/protocol/message.go but that has to match the
|
|
|
+// wire protocol, which doesn't quite line up with what we actually need to return
|
|
|
+
|
|
|
+// Message is what is returned from fetch requests.
|
|
|
+type Message struct {
|
|
|
+ Offset int64
|
|
|
+ Key []byte
|
|
|
+ Value []byte
|
|
|
+}
|