app

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0, EPL-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventLoop

func EventLoop(ctx context.Context, watchEvents chan fsnotify.Event, fileName string, launch func(fsnotify.Event))

EventLoop main event loop.

func NewRouter

func NewRouter(logger logger.Logger) *message.Router

NewRouter creates new messages router

func Run

func Run(
	ctx context.Context,
	factory LaunchFactory,
	settings config.SettingsAccessor,
	cli map[string]interface{},
	logger logger.Logger,
) error

Run runs the app.

func StartRouter

func StartRouter(r *message.Router)

StartRouter starts router instance.

func StopRouter

func StopRouter(r *message.Router)

StopRouter stops router instance.

Types

type LaunchFactory

type LaunchFactory func(client *conn.MQTTConnection, pub message.Publisher, manager conn.SubscriptionManager) Launcher

LaunchFactory returns new launcher instance

type Launcher

type Launcher interface {
	// Run triggers the launch process.
	Run(cleanSession bool, settings config.SettingsAccessor, cli map[string]interface{}, logger logger.Logger) error

	// Stop invokes launcher exit.
	Stop()
}

Launcher interface enables app launching.

func NewMockLauncher

func NewMockLauncher(client *conn.MQTTConnection, pub message.Publisher, manager conn.SubscriptionManager) Launcher

NewMockLauncher creates mock launcher for testing purposes

Jump to

Keyboard shortcuts

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