kafkastreamer

package module
v0.0.0-...-d38f95b Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnector

func NewConnector(c kafka.ReaderConfig, t Translator) *connector

Types

type Consumer

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

func (*Consumer) Close

func (c *Consumer) Close() error

func (*Consumer) Recv

func (c *Consumer) Recv(ctx context.Context) (*workflow.Event, workflow.Ack, error)

type Producer

type Producer struct {
	Topic         string
	Writer        *kafka.Writer
	WriterTimeout time.Duration
}

func (*Producer) Close

func (p *Producer) Close() error

func (*Producer) Send

func (p *Producer) Send(ctx context.Context, foreignID string, statusType int, headers map[workflow.Header]string) error

type StreamConstructor

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

func New

func New(brokers []string) *StreamConstructor

func (StreamConstructor) NewConsumer

func (s StreamConstructor) NewConsumer(ctx context.Context, topic string, name string, opts ...workflow.ConsumerOption) (workflow.Consumer, error)

func (StreamConstructor) NewProducer

func (s StreamConstructor) NewProducer(ctx context.Context, topic string) (workflow.Producer, error)

type Translator

type Translator func(m kafka.Message) workflow.ConnectorEvent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳