consumer

package
v0.0.0-...-a6f2505 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 6 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 {
	PollTimeoutMs    int
	Name             string
	BootstrapServers string
	GroupID          string
	SessionTimeoutMs string
	AutoOffsetReset  string
	SSL              SSLConfig
}

type Consumer

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

func New

func New(config Config, topics []string, handler Handler) (*Consumer, error)

func (*Consumer) HealthCheck

func (c *Consumer) HealthCheck() error

func (*Consumer) Poll

func (c *Consumer) Poll(ctx context.Context)

func (*Consumer) Run

func (c *Consumer) Run(ctx context.Context, wg *sync.WaitGroup)

type Handler

type Handler interface {
	// If 'Handle' returns an error, a message will not be committed.
	Handle(ctx context.Context, key, value []byte, timestamp time.Time) error
}

type SSLConfig

type SSLConfig struct {
	Enabled             bool
	KeyLocation         string
	CertificateLocation string
	CALocation          string
}

Jump to

Keyboard shortcuts

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