nats

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: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeTopic added in v0.34.0

func ComposeTopic(topic string, partitionID uint32) (_ string, e error)

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]](kvStore store.KVStore, logger *slog.Logger, topic string, totalPartitions uint32, url string, options ...nats.Option) (_ *Sink[K], err error)

NewSink instantiate NATS sink

func (*Sink[K]) Close

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

func (*Sink[K]) ResumeTokens added in v0.34.0

func (s *Sink[K]) ResumeTokens(ctx context.Context, forEach func(resumeToken encoding.Base64) error) 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(ctx context.Context, e *eventsourcing.Event[K], m sink.Meta) 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