streaming

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 5 Imported by: 0

README

streaming

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerHandler

type ConsumerHandler func(message Message) error
type Header struct {
	Key   string
	Value []byte
}

func HeaderFromKafka

func HeaderFromKafka(item kafka.Header) Header

func HeadersFromKafka

func HeadersFromKafka(items []kafka.Header) (values []Header)

type Message

type Message struct {
	Topic         string
	Partition     int
	Offset        int64
	HighWaterMark int64
	Key           []byte
	Value         []byte
	Headers       []Header
	Time          time.Time
}

func MessageFromKafka

func MessageFromKafka(item kafka.Message) Message

type Streaming

type Streaming interface {
	Producer(ctx context.Context, topic string, value []byte) (err error)
	Consumer(ctx context.Context, topic string, handler ConsumerHandler) (err error)
}

func NewKafka

func NewKafka(network string, brokers []string) (Streaming, error)

Jump to

Keyboard shortcuts

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