azservicebus

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package azservicebus provides a notifier that subscribes to an Service Bus topic that watches change of configuration on Azure.

It requires following roles:

  • Azure Service Bus Data Owner
  • Azure Service Bus Data Receiver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

Notifier that watches change events on given Service Bus topic.

To create a new Notifier, call NewNotifier.

func NewNotifier

func NewNotifier(namespace, topic string, opts ...Option) *Notifier

NewNotifier creates a Notifier with the given Service Bus namespace and topic.

func (*Notifier) Register

func (n *Notifier) Register(loaders ...loader)

Register registers a loader to the Notifier.

func (*Notifier) Start

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

Start starts watching events on given Service Bus topic and fanout to registered loaders. It blocks until ctx is done, or it returns an error.

type Option

type Option func(options *options)

Option configures the Notifier with specific options.

func WithCredential

func WithCredential(credential azcore.TokenCredential) Option

WithCredential provides the azcore.TokenCredential for Azure authentication.

By default, it uses azidentity.DefaultAzureCredential.

func WithLogHandler

func WithLogHandler(handler slog.Handler) Option

WithLogHandler provides the slog.Handler for logs from notifier.

By default, it uses handler from slog.Default().

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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