webserver

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// WebAssets is our single asset db instance.
	// It will be constructed by a dynamically generated method in this directory.
	WebAssets *assetdb.AssetDB = assetdb.NewAssetDB()
)

Functions

This section is empty.

Types

type WebClient

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

WebClient represents an individual web session

func (*WebClient) CallResult

func (wc *WebClient) CallResult(message string)

CallResult sends the result of the Go function call back to the originator in the frontend

func (*WebClient) DarkModeEnabled

func (wc *WebClient) DarkModeEnabled(callbackID string)

func (*WebClient) NotifyEvent

func (wc *WebClient) NotifyEvent(message string)

NotifyEvent sends the event

func (*WebClient) OpenDialog

func (wc *WebClient) OpenDialog(dialogOptions *options.OpenDialog, callbackID string)

func (*WebClient) Quit

func (wc *WebClient) Quit()

Quit terminates the webclient session

func (*WebClient) Run

func (wc *WebClient) Run(w *WebServer)

Run processes messages from the remote webclient

func (*WebClient) SaveDialog

func (wc *WebClient) SaveDialog(dialogOptions *options.SaveDialog, callbackID string)

func (*WebClient) SendMessage

func (wc *WebClient) SendMessage(message string)

SendMessage converts the string to a []byte and passes it to the connection's Writer to send to the remote client The Writer itself prevents multiple users at the same time.

func (*WebClient) UpdateContextMenus

func (wc *WebClient) UpdateContextMenus(contextMenus *menu.ContextMenus)

func (*WebClient) UpdateMenu

func (wc *WebClient) UpdateMenu(menu *menu.Menu)

func (*WebClient) UpdateTray

func (wc *WebClient) UpdateTray(menu *menu.Menu)

func (*WebClient) UpdateTrayIcon

func (wc *WebClient) UpdateTrayIcon(name string)

func (*WebClient) UpdateTrayLabel

func (wc *WebClient) UpdateTrayLabel(label string)

func (*WebClient) WindowCenter

func (wc *WebClient) WindowCenter()

func (*WebClient) WindowFullscreen

func (wc *WebClient) WindowFullscreen()

WindowFullscreen is a noop in the webclient

func (*WebClient) WindowHide

func (wc *WebClient) WindowHide()

func (*WebClient) WindowMaximise

func (wc *WebClient) WindowMaximise()

func (*WebClient) WindowMinimise

func (wc *WebClient) WindowMinimise()

func (*WebClient) WindowPosition

func (wc *WebClient) WindowPosition(x int, y int)

func (*WebClient) WindowSetColour

func (wc *WebClient) WindowSetColour(colour int)

WindowSetColour is a noop in the webclient

func (*WebClient) WindowSetTitle

func (wc *WebClient) WindowSetTitle(title string)

WindowSetTitle is a noop in the webclient

func (*WebClient) WindowShow

func (wc *WebClient) WindowShow()

func (*WebClient) WindowSize

func (wc *WebClient) WindowSize(width int, height int)

func (*WebClient) WindowUnFullscreen

func (wc *WebClient) WindowUnFullscreen()

WindowUnFullscreen is a noop in the webclient

func (*WebClient) WindowUnmaximise

func (wc *WebClient) WindowUnmaximise()

func (*WebClient) WindowUnminimise

func (wc *WebClient) WindowUnminimise()

type WebServer

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

WebServer serves the application over http

func NewWebServer

func NewWebServer(logger *logger.Logger) *WebServer

NewWebServer creates a new WebServer

func (*WebServer) SetBindings

func (w *WebServer) SetBindings(bindings *binding.Bindings)

SetBindings provides the webserver with the mapping of bindings to provide to a client

func (*WebServer) SetIP

func (w *WebServer) SetIP(ip string)

SetIP sets the server ip to listen on

func (*WebServer) SetPort

func (w *WebServer) SetPort(port int)

SetPort sets the server port to listen on

func (*WebServer) Start

func (w *WebServer) Start(dispatcher *messagedispatcher.Dispatcher, event *subsystem.Event) error

Start the webserver

func (*WebServer) URL

func (w *WebServer) URL() string

URL returns the URL that the server is serving from

Jump to

Keyboard shortcuts

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