kafka

package
v0.0.0-...-aca2af5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PingCheck

func PingCheck(
	brokers []string,
	topic string,
	store PingStore,
	staleAfter time.Duration,
	config check.Config,
) (check.Check, error)

PingCheck creates a health check for Kafka that continuously produces and consumes ping messages.

func TopicsCheck

func TopicsCheck(brokers []string, config check.Config) check.Check

TopicsCheck creates a health check for Kafka topics listing.

Types

type InMemoryPingStore

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

InMemoryPingStore keeps ping timestamps in memory with concurrency safety.

func NewInMemoryPingStore

func NewInMemoryPingStore() *InMemoryPingStore

NewInMemoryPingStore constructs a new in-memory ping store.

func (*InMemoryPingStore) LastProcessed

func (s *InMemoryPingStore) LastProcessed(_ context.Context) (time.Time, error)

LastProcessed returns the timestamp of the latest processed ping.

func (*InMemoryPingStore) SetProcessed

func (s *InMemoryPingStore) SetProcessed(_ context.Context, ts time.Time) error

SetProcessed stores the provided timestamp as the latest processed ping.

type PingStore

type PingStore interface {
	// SetProcessed stores the timestamp of a processed ping message.
	SetProcessed(ctx context.Context, ts time.Time) error
	// LastProcessed returns the timestamp of the most recently processed ping message.
	LastProcessed(ctx context.Context) (time.Time, error)
}

PingStore persists timestamps of processed ping messages.

Jump to

Keyboard shortcuts

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