kafka

package
v0.39.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

type Sink[K eventsourcing.ID] struct {
	// contains filtered or unexported fields
}

func NewSink

func NewSink[K eventsourcing.ID, PK eventsourcing.IDPt[K]](logger *slog.Logger, kvStore store.KVStore, topic string, brokers []string, config *sarama.Config) (*Sink[K], error)

NewSink instantiate a Kafka sink

func (*Sink[K]) Close

func (s *Sink[K]) Close()

func (*Sink[K]) ResumeTokens

func (s *Sink[K]) ResumeTokens(ctx context.Context, forEach func(resumeToken encoding.Base64) error) (e error)

ResumeTokens iterates over all the last saved resumed token per partition It will return 0 if there is no last message

func (*Sink[K]) SetCodec

func (s *Sink[K]) SetCodec(codec sink.Codec[K])

func (*Sink[K]) Sink

func (s *Sink[K]) Sink(_ context.Context, e *eventsourcing.Event[K], m sink.Meta) (er error)

Sink sends the event to the message queue

Jump to

Keyboard shortcuts

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