kafka

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package kafka provides Kafka message queue sending wrapper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProducer

func GetProducer() result.Result[sarama.SyncProducer]

GetProducer returns the Kafka sync producer and initialization error.

func Refresh

func Refresh()

Refresh initializes or reconnects the Kafka producer.

Types

type KafkaSender

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

KafkaSender sends messages to the specified topic.

func New

func New() *KafkaSender

New creates a KafkaSender instance.

func (*KafkaSender) Push

func (p *KafkaSender) Push(data map[string]interface{}) result.VoidResult

Push sends data as JSON to the configured topic.

func (*KafkaSender) SetTopic

func (p *KafkaSender) SetTopic(topic string)

SetTopic sets the topic for sending messages.

Jump to

Keyboard shortcuts

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