mux

package
v0.0.0-...-cbf242d Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 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
}

func New

func New(client connect.ConnectClient) *Mux

Start starts the updates service, listening for updates from the cloud until the context is canceled

func (*Mux) Run

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

func (*Mux) Watch

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

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

type WatchOption

type WatchOption func(*config)

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