pubsub

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 14 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

View Source
var (

	// ErrUnknownResourceType is returned when the corresponding resource type is not found for a resource id.
	ErrUnknownResourceType = errors.New("unknown resource type")
)

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, subscriber events.AuthRelationshipSubscriber, engine query.Engine, opts ...SubscriberOption) (*Subscriber, error)

NewSubscriber creates a new Subscriber

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

Jump to

Keyboard shortcuts

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