Documentation ¶
Overview ¶
Package subscriber implements Kafka Consumer for Go.
Example (Minimal) ¶
package main import ( "fmt" "log" "github.com/dimmyjr/goku/message" "github.com/dimmyjr/goku/subscriber" "github.com/dimmyjr/goku/types" ) func main() { kafkaURL := "localhost:9092" topic := "topic-segmentio" groupID := "tests" consumer, err := subscriber.NewConsumer([]string{kafkaURL}, topic, groupID, types.Segmentio) if err != nil { log.Fatal("error to initialize producer") } consumer.Subscribe(read) } func read(msg *message.Message) error { fmt.Print(&msg.Value) return nil }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUndefinedProvider = errors.New("undefinedProvider")
ErrUndefinedProvider : undefined provider error.
Functions ¶
Types ¶
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.