messagedispatcher

package
v2.0.0-beta.40 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT Imports: 11 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)
	OpenFileDialog(dialogOptions runtime.OpenDialogOptions, callbackID string)
	OpenMultipleFilesDialog(dialogOptions runtime.OpenDialogOptions, callbackID string)
	OpenDirectoryDialog(dialogOptions runtime.OpenDialogOptions, callbackID string)
	SaveDialog(dialogOptions runtime.SaveDialogOptions, callbackID string)
	MessageDialog(dialogOptions runtime.MessageDialogOptions, callbackID string)
	WindowSetTitle(title string)
	WindowShow()
	WindowHide()
	WindowCenter()
	WindowMaximise()
	WindowUnmaximise()
	WindowMinimise()
	WindowUnminimise()
	WindowPosition(x int, y int)
	WindowSize(width int, height int)
	WindowSetMinSize(width int, height int)
	WindowSetMaxSize(width int, height int)
	WindowFullscreen()
	WindowUnfullscreen()
	WindowSetColour(colour int)
	DarkModeEnabled(callbackID string)
	SetApplicationMenu(menuJSON string)
	SetTrayMenu(trayMenuJSON string)
	UpdateTrayMenuLabel(JSON string)
	UpdateContextMenu(contextMenuJSON string)
	DeleteTrayMenuByID(id 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) Close

func (d *Dispatcher) Close()

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