Browse Source

Follow-up re-org after split

Evan Huus 12 years ago
parent
commit
9ee24646f9
5 changed files with 13 additions and 11 deletions
  1. 0 7
      kafka/encoder.go
  2. 6 0
      kafka/errors.go
  3. 1 1
      kafka/metadata_cache.go
  4. 6 0
      kafka/utils.go
  5. 0 3
      protocol/errors.go

+ 0 - 7
kafka/encoder.go

@@ -1,7 +0,0 @@
-package kafka
-
-// A simple interface for any type that can be encoded as an array of bytes
-// in order to be sent as the key or value of a Kafka message.
-type Encoder interface {
-	Encode() ([]byte, error)
-}

+ 6 - 0
kafka/errors.go

@@ -0,0 +1,6 @@
+package kafka
+
+import "errors"
+
+// Error returned when the client has run out of brokers to talk to (none of them are responding).
+var OutOfBrokers = errors.New("kafka: Client has run out of available brokers to talk to. Is your cluster reachable?")

+ 1 - 1
kafka/metadata_cache.go

@@ -150,7 +150,7 @@ func (mc *metadataCache) refreshTopics(topics []*string) error {
 
 	}
 
-	return k.OutOfBrokers
+	return OutOfBrokers
 }
 
 func (mc *metadataCache) refreshTopic(topic string) error {

+ 6 - 0
kafka/utils.go

@@ -24,3 +24,9 @@ type encodableString string
 func (s encodableString) Encode() ([]byte, error) {
 	return []byte(s), nil
 }
+
+// A simple interface for any type that can be encoded as an array of bytes
+// in order to be sent as the key or value of a Kafka message.
+type Encoder interface {
+	Encode() ([]byte, error)
+}

+ 0 - 3
protocol/errors.go

@@ -60,9 +60,6 @@ func (err KError) Error() string {
 	}
 }
 
-// Error returned when the client has run out of brokers to talk to (none of them are responding).
-var OutOfBrokers = errors.New("kafka: Client has run out of available brokers to talk to. Is your cluster reachable?")
-
 // Error returned when calling Connect() on a Broker that is already connected.
 var AlreadyConnected = errors.New("kafka: broker: already connected")