Documentation ¶
Index ¶
Constants ¶
const ( TopicPlaceholder string = "%t" PartitionPlaceholder string = "%p" OffsetPlaceholder string = "%o" TimestampPlaceholder string = "%e" KeyPlaceholder string = "%k" ValuePlaceholder string = "%v" )
Valid format string placeholders.
const ( StartOldest int64 = -1 StartNow int64 = -2 EndNow int64 = -3 EndNever int64 = -4 )
Special time values
const MessageBufferSize = 256
MessageBufferSize is the default buffer size for consuming/producing.
Variables ¶
This section is empty.
Functions ¶
func EndHelp ¶ added in v0.4.0
func EndHelp() string
EndHelp returns a message describing valid end values.
func FormatterHelp ¶
func FormatterHelp() string
FormatterHelp returns a message describing format tokens.
func ParseStart ¶
ParseStart returns a start time parsed from s.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is a high level API for a Kafka consumer.
func NewConsumer ¶
NewConsumer returns a Consumer for the given broker.
type ConsumerRequest ¶ added in v0.4.0
type ConsumerRequest struct {
// contains filtered or unexported fields
}
A ConsumerRequest specifies what to consume and how.
func NewConsumerRequest ¶ added in v0.4.0
func NewConsumerRequest(topic string, start int64, end int64) (ConsumerRequest, error)
NewConsumerRequest creates a valid ConsumerRequest.
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter describes a way of printing Kafka messages.
func NewFormatter ¶
NewFormatter returns a Formatter initialized with a format string.
type Message ¶
type Message struct { Topic string Partition int32 Offset int64 Timestamp time.Time Key string Value string }
Message represents a Kafka message.
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer is a high level API for a Kafka producer.
func NewProducer ¶
NewProducer returns a Producer for the given broker.