internal

package
v0.0.0-...-21aeb0e Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 5 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 struct {
	// contains filtered or unexported fields
}

Consumer is struct for consumers

func NewConsumer

func NewConsumer() *Consumer

NewConsumer return instance of consumer

func (*Consumer) ConnectConsumer

func (c *Consumer) ConnectConsumer(urls []string) error

ConnectConsumer is connect in kafka

func (*Consumer) ConsumeMessage

func (c *Consumer) ConsumeMessage(topic string) error

ConsumeMessage return messages from Kafka

type Kafka

type Kafka struct {
	Producers []*Producer
	Consumers []*Consumer
}

Kafka is struct for kafka broker

func NewKafka

func NewKafka() *Kafka

NewKafka return instance of kafka

func (*Kafka) ConnectConsumers

func (k *Kafka) ConnectConsumers(urls []string) error

ConnectConsumers connect all consumers in broker

func (*Kafka) ConnectProducers

func (k *Kafka) ConnectProducers(urls []string) error

ConnectProducers connect all producers in broker

func (*Kafka) CreateConsumers

func (k *Kafka) CreateConsumers(quantity int) error

CreateConsumers generate consumers the kafka

func (*Kafka) CreateProducers

func (k *Kafka) CreateProducers(quantity int) error

CreateProducers generate producers the kafka

func (*Kafka) ExecuteConsumers

func (k *Kafka) ExecuteConsumers(topic string) error

ExecuteConsumers execute logic for all consumers in broker

func (*Kafka) ExecuteProducers

func (k *Kafka) ExecuteProducers(topic string) (err error)

ExecuteProducers execute logic for all producers in broker

type Message

type Message struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Phone string `json:"phone"`
}

Message is struct for message

type Producer

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

Producer is struct for producers

func NewProducer

func NewProducer() *Producer

NewProducer return instance of producer

func (*Producer) ConnectProducer

func (p *Producer) ConnectProducer(urls []string) error

ConnectProducer is connect in kafka

func (*Producer) ProduceMessage

func (p *Producer) ProduceMessage(topic string) error

ProduceMessage execut send the msg to kafka

Jump to

Keyboard shortcuts

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