consumer

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 11 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

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
}

Jump to

Keyboard shortcuts

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