pubsub

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package pubsub provides functions and data for a NATS consumer listening for resource lifecycle events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber added in v0.1.4

type Subscriber struct {
	// contains filtered or unexported fields
}

Subscriber is the subscriber client

func NewSubscriber added in v0.1.4

func NewSubscriber(ctx context.Context, cfg events.SubscriberConfig, engine query.Engine, opts ...SubscriberOption) (*Subscriber, error)

NewSubscriber creates a new Subscriber

func (*Subscriber) Close added in v0.1.4

func (s *Subscriber) Close() error

Close closes the subscriber connection and unsubscribes from all subscriptions

func (Subscriber) Listen added in v0.1.4

func (s Subscriber) Listen() error

Listen start listening for messages on registered subjects and calls the registered message handler

func (*Subscriber) Subscribe added in v0.1.4

func (s *Subscriber) Subscribe(topic string) error

Subscribe subscribes to a nats subject

type SubscriberOption added in v0.1.4

type SubscriberOption func(s *Subscriber)

SubscriberOption is a functional option for the Subscriber

func WithLogger

func WithLogger(l *zap.SugaredLogger) SubscriberOption

WithLogger sets the logger for the Subscriber

func WithNatsSubOpts added in v0.1.4

func WithNatsSubOpts(options ...nc.SubOpt) SubscriberOption

WithNatsSubOpts sets the logger for the Subscriber

Jump to

Keyboard shortcuts

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