messagedispatcher

package
v2.0.0-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Quit()
	NotifyEvent(message string)
	CallResult(message string)
	OpenDialog(dialogOptions *dialog.OpenDialog, callbackID string)
	SaveDialog(dialogOptions *dialog.SaveDialog, callbackID string)
	MessageDialog(dialogOptions *dialog.MessageDialog, callbackID string)
	WindowSetTitle(title string)
	WindowShow()
	WindowHide()
	WindowCenter()
	WindowMaximise()
	WindowUnmaximise()
	WindowMinimise()
	WindowUnminimise()
	WindowPosition(x int, y int)
	WindowSize(width int, height int)
	WindowFullscreen()
	WindowUnFullscreen()
	WindowSetColour(colour int)
	DarkModeEnabled(callbackID string)
	SetApplicationMenu(menuJSON string)
	SetTrayMenu(trayMenuJSON string)
	UpdateTrayMenuLabel(JSON string)
	UpdateContextMenu(contextMenuJSON string)
}

Client defines what a frontend client can do

type DispatchClient

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

DispatchClient is what the frontends use to interface with the dispatcher

func (*DispatchClient) DispatchMessage

func (d *DispatchClient) DispatchMessage(incomingMessage string)

DispatchMessage is called by the front ends. It is passed an IPC message, translates it to a more concrete message type then publishes it on the service bus.

type Dispatcher

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

Dispatcher translates messages received from the frontend and publishes them onto the service bus

func New

func New(servicebus *servicebus.ServiceBus, logger *logger.Logger) (*Dispatcher, error)

New dispatcher. Needs a service bus to send to.

func (*Dispatcher) RegisterClient

func (d *Dispatcher) RegisterClient(client Client) *DispatchClient

RegisterClient will register the given callback with the dispatcher and return a DispatchClient that the caller can use to send messages

func (*Dispatcher) RemoveClient

func (d *Dispatcher) RemoveClient(dc *DispatchClient)

RemoveClient will remove the registered client

func (*Dispatcher) Start

func (d *Dispatcher) Start() error

Start the subsystem

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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