kafka

package
v0.0.0-...-a1db402 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TLS struct {
		CAFile   string
		KeyFile  string
		CertFile string
	}
}

Config defines the Kafka connection configuration

type Consumer

type Consumer struct {

	// HandleMessage will be called upon every consumption
	HandleMessage HandleFn
	// contains filtered or unexported fields
}

Consumer consumes website checks from a Kafka topic

func NewConsumer

func NewConsumer(addrs []string, cfg Config, handleFn HandleFn) (*Consumer, error)

NewConsumer creates the consumer group from the given addresses

func (*Consumer) Close

func (c *Consumer) Close() error

Close closes the resources of the consumer

func (*Consumer) Consume

func (c *Consumer) Consume(ctx context.Context) error

Consume will loop forever consuming Kafka topics

type HandleFn

type HandleFn func(ctx context.Context, wp domain.WebsiteParams, wr domain.WebsiteResult) error

Jump to

Keyboard shortcuts

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