producer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 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 KafkaProducer

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

func NewKafkaProducer

func NewKafkaProducer(configuration *configuration.KafkaConfiguration) (*KafkaProducer, error)

func (*KafkaProducer) Close

func (producer *KafkaProducer) Close()

func (*KafkaProducer) Produce

func (producer *KafkaProducer) Produce(topic string, message any) error

type Producer

type Producer interface {
	// Produce sends a message to the broker with the given topic
	Produce(topic string, message any) error
	// Close closes connection and frees any used resources
	Close()
}

Producer is responsible for sending messages over to the message broker

Jump to

Keyboard shortcuts

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