Documentation ¶
Index ¶
- type Koff
- func (k *Koff) GetConsumerGroupOffsets(consumerGroup, topic string, version OffsetVersion, partitions ...int32) (map[int32]int64, error)
- func (k *Koff) GetDrift(consumerGroup, topic string, version OffsetVersion, partitions ...int32) (map[int32]int64, error)
- func (k *Koff) GetNewestOffsets(topic string, partitions ...int32) (map[int32]int64, error)
- func (k *Koff) GetOldestOffsets(topic string, partitions ...int32) (res map[int32]int64, err error)
- func (k *Koff) Init() error
- func (k *Koff) OffsetInAvailableRange(topic string, offset int64, partitions ...int32) (bool, error)
- type OffsetVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Koff ¶
type Koff struct {
// contains filtered or unexported fields
}
Koff provides method to get and compare offsets of consumer groups.
func (*Koff) GetConsumerGroupOffsets ¶
func (k *Koff) GetConsumerGroupOffsets(consumerGroup, topic string, version OffsetVersion, partitions ...int32) (map[int32]int64, error)
GetConsumerGroupOffsets retrieves the last committed offsets for the given consumer group. Returns a map of partitions to offset.
func (*Koff) GetDrift ¶
func (k *Koff) GetDrift(consumerGroup, topic string, version OffsetVersion, partitions ...int32) (map[int32]int64, error)
GetDrift computes the drift between the last comitted offsets of a consumer group and the newest offsets available for a topic and partition.
Returns a map of partitions to offset.
func (*Koff) GetNewestOffsets ¶
GetNewestOffsets retrieves the newest available offsets for each partitions of the provided topic.
Returns a map of partitions to offset.
func (*Koff) GetOldestOffsets ¶
GetOldestOffsets retrieves the oldest available offsets for each partitions of the provided topic.
Returns a map of partitions to offset.
func (*Koff) Init ¶
Init initializes the state of the Koff instance.
It queries the Kafka cluster for a list of topics and refreshes the metadata for each topic.
func (*Koff) OffsetInAvailableRange ¶
func (k *Koff) OffsetInAvailableRange(topic string, offset int64, partitions ...int32) (bool, error)
OffsetInAvailableRange check that the provided offset is in the available range of the topic and partitions.
If multiple partitions are provided, the offset is checked for all partitions.
type OffsetVersion ¶
type OffsetVersion int16
const ( ZKOffsetVersion OffsetVersion = 0 KafkaOffsetVersion OffsetVersion = 1 )
func (*OffsetVersion) Set ¶
func (v *OffsetVersion) Set(s string) error
func (OffsetVersion) String ¶
func (v OffsetVersion) String() string