source

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt

type Opt func(o *Opts)

Opt is a NATS source option.

type Opts

type Opts struct{}

Opts is a set of options for a NATS source.

func DefaultOpts

func DefaultOpts() *Opts

DefaultOpts is a function that returns a set of default options for a NATS source.

func (*Opts) Configure

func (o *Opts) Configure(opts ...Opt)

Configure is a function that configures a NATS source.

type Source

type Source[K, V any] struct {
	// contains filtered or unexported fields
}

Source is a source of NATS messages.

func WithContext

func WithContext[K, V any](ctx context.Context, sub *nats.Subscription, key codec.Decoder[K], value codec.Decoder[V], opts ...Opt) *Source[K, V]

WithContext is a function that configures a NATS source with a context.

func (*Source[K, V]) Commit

func (s *Source[K, V]) Commit(_ ...msg.Message[K, V]) error

Commit is a function that commits a NATS message.

func (*Source[K, V]) Error

func (s *Source[K, V]) Error() error

Error is a function that returns the error of a NATS source.

func (*Source[K, V]) Messages

func (s *Source[K, V]) Messages() chan msg.Message[K, V]

Messages is a function that returns a channel of NATS messages.

Jump to

Keyboard shortcuts

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