Browse Source

Don't put message in its own file, it's not big enough to bother

Evan Huus 12 years ago
parent
commit
67829127e3
2 changed files with 11 additions and 12 deletions
  1. 0 11
      kafka/message.go
  2. 11 1
      kafka/utils.go

+ 0 - 11
kafka/message.go

@@ -1,11 +0,0 @@
-package kafka
-
-// Message is what is returned from fetch requests.
-type Message struct {
-	Offset int64
-	Key    []byte
-	Value  []byte
-}
-
-// (it doesn't quite line up with what kafka encodes as a message, but that's because
-// theirs seems odd - it's missing the message offset for one thing...)

+ 11 - 1
kafka/utils.go

@@ -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
+}