consumer

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Start(ctx context.Context)
	RegisterHandler(handler EventHandler)
	Close()
}

func NewKafkaConsumer

func NewKafkaConsumer(opts *KafkaConsumerOpts) Consumer

type Event added in v0.2.5

type Event struct {
	ID        uuid.UUID   `json:"id"`
	PartyID   uuid.UUID   `json:"party_id"`
	Type      string      `json:"type"`
	Publisher string      `json:"publisher"`
	Payload   interface{} `json:"payload"`
}

type EventHandler

type EventHandler interface {
	Name() string
	Handle(ctx context.Context, event *Event) error
}

type KafkaConsumerOpts

type KafkaConsumerOpts struct {
	Brokers    string
	GroupID    string
	Topic      string
	MinBytes   int
	MaxBytes   int
	MaxRetry   int
	SASLConfig *KafkaSASLOpts
}

type KafkaSASLOpts added in v0.2.7

type KafkaSASLOpts struct {
	Username string
	Password string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳