nats

package
v0.0.0-...-2f88d79 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NatsSubscription

type NatsSubscription struct {
	*event.Router
	// contains filtered or unexported fields
}

NatsSubscription encapsulates the jetstream session providing events.

Extends Router.

func NewNatsSubscription

func NewNatsSubscription(handler *apievent.EventsHandler) *NatsSubscription

NewNatsSubscription creates a new NatsSubscription with the given user store.

func (*NatsSubscription) Close

func (n *NatsSubscription) Close() error

Close cleanly brings down the nats and jetstream connection.

func (*NatsSubscription) Connect

func (n *NatsSubscription) Connect(ctx context.Context, connStr string) error

Connect sets up the connection to the nats server and a consumer for the "Jetstream".

Fails if connection fails or the "Jetstream" consumer cannot be set up.

Once connected, it will attempt to reconnect if disconnected.

Jump to

Keyboard shortcuts

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