kafka

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) func(ctx context.Context) error

New creates new Kafka health check that verifies the following: - connection establishing - publishing a ping message and verifying the response

Types

type Config

type Config struct {
	// Bootstrap of Kafka cluster. Required.
	Bootstrap []string
	// Version of Kafka
	Version string
	// ServiceName name of service which is implementing health check
	ServiceName string
	// Timeout of a cycle of produce and consume
	Timeout time.Duration
	// CustomTopicName optional custom topic name
	CustomTopicName string
}

Config is the Kafka checker configuration settings container.

type Consumer added in v1.2.13

type Consumer interface {
	AddClaimer(string, MessageClaimer)
	AddSetupHook(hook Hook)
	AddCleanupHook(hook Hook)
}

type Hook added in v1.2.13

type Hook func(session sarama.ConsumerGroupSession)

type MessageClaimer added in v1.2.13

type MessageClaimer func(*sarama.ConsumerMessage) bool

type Server added in v1.2.13

type Server interface {
	Listen(wg *sync.WaitGroup, close <-chan struct{})
	Close() error
	GetConsumer() sarama.ConsumerGroup
}

Jump to

Keyboard shortcuts

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