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 *options.OpenDialog, callbackID string) SaveDialog(dialogOptions *options.SaveDialog, callbackID string) MessageDialog(dialogOptions *options.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) UpdateMenu(menu *menu.Menu) UpdateTray(menu *menu.Menu) UpdateTrayLabel(label string) UpdateTrayIcon(name string) UpdateContextMenus(contextMenus *menu.ContextMenus) }
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
Click to show internal directories.
Click to hide internal directories.