Skip to content

Commit

Permalink
Add ConsumerRequest struct
Browse files Browse the repository at this point in the history
  • Loading branch information
maximepeschard committed Jun 13, 2020
1 parent 561d764 commit 9c264c0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ import (
"github.com/Shopify/sarama"
)

// A ConsumerRequest specifies what to consume and how.
type ConsumerRequest struct {
Topic string
StartTime int64
Quit bool
}

// NewConsumerRequest returns a ConsumerRequest.
func NewConsumerRequest(topic string, startTime int64, quit bool) ConsumerRequest {
cr := ConsumerRequest{
Topic: topic,
StartTime: startTime,
Quit: quit,
}

return cr
}

// Consumer is a high level API for a Kafka consumer.
type Consumer struct {
broker string
Expand Down

0 comments on commit 9c264c0

Please sign in to comment.