streaming

package
v0.0.0-...-04b7820 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 9 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 {
	Version   string
	Brokers   string
	Topic     []string
	Producers int
	Verbose   bool
	// consumer config
	Assignor string
	Oldest   bool
	Group    string
	Ctx      context.Context
}

type Consumer

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

func NewConsumer

func NewConsumer(cfg *Config) (*Consumer, error)

func (*Consumer) Cleanup

func (consumer *Consumer) Cleanup(sarama.ConsumerGroupSession) error

func (*Consumer) Consume

func (consumer *Consumer) Consume(topics string, messageHandler func(msg *sarama.ConsumerMessage) error) error

func (*Consumer) ConsumeClaim

func (consumer *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*Consumer) Setup

func (consumer *Consumer) Setup(sarama.ConsumerGroupSession) error

func (*Consumer) ToggleConsumptionFlow

func (c *Consumer) ToggleConsumptionFlow()

type EventConsumers

type EventConsumers map[string]func(msg *sarama.ConsumerMessage) error

type EventProducer

type EventProducer interface {
	BroadCast(count int, eventName string, payload []byte) error
	Clear()
}

func NewProducer

func NewProducer(c *Config) (EventProducer, error)

type Producer

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

func (*Producer) BroadCast

func (p *Producer) BroadCast(count int, eventName string, payload []byte) error

func (*Producer) Clear

func (p *Producer) Clear()

type UserRegistrationEvent

type UserRegistrationEvent struct {
}

Jump to

Keyboard shortcuts

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