mux

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package mux provides the way to listen for updates from the cloud

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mux

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

Mux is the service that listens for updates from the cloud

func New

func New(client connect.ConnectClient) *Mux

New creates a new mux service that listens for updates from the cloud

func (*Mux) Run

func (svc *Mux) Run(ctx context.Context, opts ...fanout.Option) error

Run starts the service

func (*Mux) Watch

func (svc *Mux) Watch(ctx context.Context, opts ...WatchOption) error

Watch watches for changes to the config until either context is canceled, or an error occurs while muxing

type WatchOption

type WatchOption func(*config)

WatchOption allows to specify callbacks for various events

func WithOnBootstrapConfigUpdated

func WithOnBootstrapConfigUpdated(onBootstrapConfigUpdated func(context.Context)) WatchOption

WithOnBootstrapConfigUpdated sets the callback for when the bootstrap config is updated

func WithOnBundleUpdated

func WithOnBundleUpdated(onBundleUpdated func(ctx context.Context, key string)) WatchOption

WithOnBundleUpdated sets the callback for when the bundle is updated

func WithOnConnected

func WithOnConnected(onConnected func(context.Context)) WatchOption

WithOnConnected sets the callback for when the connection is established

func WithOnDisconnected

func WithOnDisconnected(onDisconnected func(context.Context)) WatchOption

WithOnDisconnected sets the callback for when the connection is lost

Jump to

Keyboard shortcuts

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