offset

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeTotalLag

func ComputeTotalLag(src, dst map[int32]int64) int64

ComputeTotalLag computes the total offset lag across all partitions. For partitions missing from dst, the full source offset counts as lag.

func SortedPartitionIDs

func SortedPartitionIDs(src, dst map[int32]int64) []int32

SortedPartitionIDs returns the union of partition IDs from two offset maps, sorted ascending.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides offset operations against a Kafka cluster.

func NewOffsetService

func NewOffsetService(client sarama.Client) *Service

NewOffsetService creates a Service backed by the given Kafka client.

func (*Service) Close

func (t *Service) Close() error

Close closes the underlying Kafka client.

func (*Service) Exists

func (t *Service) Exists(topic string) (bool, error)

Exists checks whether a topic exists on the cluster by refreshing metadata.

func (*Service) Get

func (t *Service) Get(topic string) (map[int32]int64, error)

Get fetches the log end offset (LEO) for every partition of a topic. Requests are batched by leader broker for efficiency.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL