notifier

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationTopic

type NotificationTopic string
const (
	NotificationTopicControl    NotificationTopic = "river_control"
	NotificationTopicInsert     NotificationTopic = "river_insert"
	NotificationTopicLeadership NotificationTopic = "river_leadership"
)

type Notifier

type Notifier struct {
	baseservice.BaseService
	startstop.BaseStartStop
	// contains filtered or unexported fields
}

func New

func New(archetype *baseservice.Archetype, listener riverdriver.Listener, statusChangeFunc func(componentstatus.Status)) *Notifier

func (*Notifier) Listen

func (n *Notifier) Listen(ctx context.Context, topic NotificationTopic, notifyFunc NotifyFunc) (*Subscription, error)

func (*Notifier) Start added in v0.1.0

func (n *Notifier) Start(ctx context.Context) error

type NotifyFunc

type NotifyFunc func(topic NotificationTopic, payload string)

type Subscription

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

func (*Subscription) Unlisten

func (s *Subscription) Unlisten(ctx context.Context)

Jump to

Keyboard shortcuts

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