Documentation ¶
Index ¶
- Variables
- type App
- type AppConfig
- type CustomLogger
- func (c *CustomLogger) Debug(message string)
- func (c *CustomLogger) DebugFields(message string, fields Fields)
- func (c *CustomLogger) Debugf(message string, args ...interface{})
- func (c *CustomLogger) Error(message string)
- func (c *CustomLogger) ErrorFields(message string, fields Fields)
- func (c *CustomLogger) Errorf(message string, args ...interface{})
- func (c *CustomLogger) Fatal(message string)
- func (c *CustomLogger) FatalFields(message string, fields Fields)
- func (c *CustomLogger) Fatalf(message string, args ...interface{})
- func (c *CustomLogger) Info(message string)
- func (c *CustomLogger) InfoFields(message string, fields Fields)
- func (c *CustomLogger) Infof(message string, args ...interface{})
- func (c *CustomLogger) Panic(message string)
- func (c *CustomLogger) PanicFields(message string, fields Fields)
- func (c *CustomLogger) Panicf(message string, args ...interface{})
- func (c *CustomLogger) Warn(message string)
- func (c *CustomLogger) WarnFields(message string, fields Fields)
- func (c *CustomLogger) Warnf(message string, args ...interface{})
- type Fields
- type Headless
- func (h *Headless) Callback(data string) error
- func (h *Headless) Close()
- func (h *Headless) Fullscreen()
- func (h *Headless) Initialise(appConfig *AppConfig, ipcManager *ipcManager, eventManager *eventManager) error
- func (h *Headless) NewBinding(methodName string) error
- func (h *Headless) NotifyEvent(event *eventData) error
- func (h *Headless) Run() error
- func (h *Headless) SelectDirectory() string
- func (h *Headless) SelectFile() string
- func (h *Headless) SelectSaveFile() string
- func (h *Headless) SetColour(colour string) error
- func (h *Headless) SetTitle(title string)
- func (h *Headless) UnFullscreen()
- type Renderer
- type Runtime
- type RuntimeBrowser
- type RuntimeDialog
- type RuntimeEvents
- type RuntimeFileSystem
- type RuntimeLog
- type RuntimeWindow
Constants ¶
This section is empty.
Variables ¶
var BuildMode = cmd.BuildModeProd
BuildMode indicates what mode we are in
var GlobalRuntimeBrowser = newRuntimeBrowser()
GlobalRuntimeBrowser is the global instance of the RuntimeBrowser object Why? Because we need to use it in both the runtime and from the frontend
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App defines the main application struct
func CreateApp ¶
CreateApp creates the application window with the given configuration If none given, the defaults are used
type AppConfig ¶
type AppConfig struct {
Width, Height int
Title string
HTML string
JS string
CSS string
Colour string
Resizable bool
DisableInspector bool
// contains filtered or unexported fields
}
AppConfig is the configuration structure used when creating a Wails App object
type CustomLogger ¶
type CustomLogger struct {
// contains filtered or unexported fields
}
CustomLogger is a wrapper object to logrus
func (*CustomLogger) DebugFields ¶
func (c *CustomLogger) DebugFields(message string, fields Fields)
DebugFields - message with fields
func (*CustomLogger) Debugf ¶
func (c *CustomLogger) Debugf(message string, args ...interface{})
Debugf - formatted message
func (*CustomLogger) ErrorFields ¶
func (c *CustomLogger) ErrorFields(message string, fields Fields)
ErrorFields - message with fields
func (*CustomLogger) Errorf ¶
func (c *CustomLogger) Errorf(message string, args ...interface{})
Errorf - formatted message
func (*CustomLogger) FatalFields ¶
func (c *CustomLogger) FatalFields(message string, fields Fields)
FatalFields - message with fields
func (*CustomLogger) Fatalf ¶
func (c *CustomLogger) Fatalf(message string, args ...interface{})
Fatalf - formatted message
func (*CustomLogger) InfoFields ¶
func (c *CustomLogger) InfoFields(message string, fields Fields)
InfoFields - message with fields
func (*CustomLogger) Infof ¶
func (c *CustomLogger) Infof(message string, args ...interface{})
Infof - formatted message
func (*CustomLogger) PanicFields ¶
func (c *CustomLogger) PanicFields(message string, fields Fields)
PanicFields - message with fields
func (*CustomLogger) Panicf ¶
func (c *CustomLogger) Panicf(message string, args ...interface{})
Panicf - formatted message
func (*CustomLogger) WarnFields ¶
func (c *CustomLogger) WarnFields(message string, fields Fields)
WarnFields - message with fields
func (*CustomLogger) Warnf ¶
func (c *CustomLogger) Warnf(message string, args ...interface{})
Warnf - formatted message
type Fields ¶
type Fields map[string]interface{}
Fields is used by the customLogger object to output fields along with a message
type Headless ¶
type Headless struct {
// contains filtered or unexported fields
}
Headless is a backend that opens a local web server and renders the files over a websocket
func (*Headless) Close ¶
func (h *Headless) Close()
Close is unsupported for Headless but required for the Renderer interface
func (*Headless) Fullscreen ¶
func (h *Headless) Fullscreen()
Fullscreen is unsupported for Headless but required for the Renderer interface
func (*Headless) Initialise ¶
func (h *Headless) Initialise(appConfig *AppConfig, ipcManager *ipcManager, eventManager *eventManager) error
Initialise the Headless Renderer
func (*Headless) NewBinding ¶
NewBinding creates a new binding with the frontend
func (*Headless) NotifyEvent ¶
NotifyEvent notifies the frontend of an event
func (*Headless) SelectDirectory ¶
SelectDirectory is unsupported for Headless but required for the Renderer interface
func (*Headless) SelectFile ¶
SelectFile is unsupported for Headless but required for the Renderer interface
func (*Headless) SelectSaveFile ¶
SelectSaveFile is unsupported for Headless but required for the Renderer interface
func (*Headless) SetColour ¶
SetColour is unsupported for Headless but required for the Renderer interface
func (*Headless) SetTitle ¶
SetTitle is currently unsupported for Headless but required for the Renderer interface
func (*Headless) UnFullscreen ¶
func (h *Headless) UnFullscreen()
UnFullscreen is unsupported for Headless but required for the Renderer interface
type Renderer ¶
type Renderer interface { Initialise(*AppConfig, *ipcManager, *eventManager) error Run() error // Binding NewBinding(bindingName string) error Callback(data string) error // Events NotifyEvent(eventData *eventData) error // Dialog Runtime SelectFile() string SelectDirectory() string SelectSaveFile() string // Window Runtime SetColour(string) error Fullscreen() UnFullscreen() SetTitle(title string) Close() }
Renderer is an interface describing a Wails target to render the app to
type Runtime ¶
type Runtime struct { Events *RuntimeEvents Log *RuntimeLog Dialog *RuntimeDialog Window *RuntimeWindow Browser *RuntimeBrowser FileSystem *RuntimeFileSystem }
Runtime is the Wails Runtime Interface, given to a user who has defined the WailsInit method
type RuntimeBrowser ¶ added in v0.17.0
type RuntimeBrowser struct { }
RuntimeBrowser exposes browser methods to the runtime
func (*RuntimeBrowser) OpenFile ¶ added in v0.17.0
func (r *RuntimeBrowser) OpenFile(filePath string) error
OpenFile opens the given file in the system's default browser
func (*RuntimeBrowser) OpenURL ¶ added in v0.17.0
func (r *RuntimeBrowser) OpenURL(url string) error
OpenURL opens the given url in the system's default browser
type RuntimeDialog ¶
type RuntimeDialog struct {
// contains filtered or unexported fields
}
RuntimeDialog exposes an interface to native dialogs
func (*RuntimeDialog) SelectDirectory ¶
func (r *RuntimeDialog) SelectDirectory() string
SelectDirectory prompts the user to select a directory
func (*RuntimeDialog) SelectFile ¶
func (r *RuntimeDialog) SelectFile() string
SelectFile prompts the user to select a file
func (*RuntimeDialog) SelectSaveFile ¶
func (r *RuntimeDialog) SelectSaveFile() string
SelectSaveFile prompts the user to select a file for saving
type RuntimeEvents ¶
type RuntimeEvents struct {
// contains filtered or unexported fields
}
RuntimeEvents exposes the events interface
func (*RuntimeEvents) Emit ¶
func (r *RuntimeEvents) Emit(eventName string, optionalData ...interface{})
Emit pass through
func (*RuntimeEvents) On ¶
func (r *RuntimeEvents) On(eventName string, callback func(optionalData ...interface{}))
On pass through
type RuntimeFileSystem ¶ added in v0.11.1
type RuntimeFileSystem struct { }
RuntimeFileSystem exposes file system utilities to the runtime
func (*RuntimeFileSystem) HomeDir ¶ added in v0.11.1
func (r *RuntimeFileSystem) HomeDir() (string, error)
HomeDir returns the user's home directory
type RuntimeLog ¶
type RuntimeLog struct { }
RuntimeLog exposes the logging interface to the runtime
func (*RuntimeLog) New ¶
func (r *RuntimeLog) New(prefix string) *CustomLogger
New creates a new logger
type RuntimeWindow ¶
type RuntimeWindow struct {
// contains filtered or unexported fields
}
RuntimeWindow exposes an interface for manipulating the window
func (*RuntimeWindow) Close ¶
func (r *RuntimeWindow) Close()
Close shuts down the window and therefore the app
func (*RuntimeWindow) Fullscreen ¶
func (r *RuntimeWindow) Fullscreen()
Fullscreen makes the window fullscreen
func (*RuntimeWindow) SetColour ¶
func (r *RuntimeWindow) SetColour(colour string) error
SetColour sets the the window colour
func (*RuntimeWindow) SetTitle ¶
func (r *RuntimeWindow) SetTitle(title string)
SetTitle sets the the window title
func (*RuntimeWindow) UnFullscreen ¶
func (r *RuntimeWindow) UnFullscreen()
UnFullscreen attempts to restore the window to the size/position before fullscreen
Source Files ¶
- app.go
- app_cli.go
- app_config.go
- binding_function.go
- binding_internal.go
- binding_manager.go
- binding_method.go
- event_manager.go
- ipc_call.go
- ipc_event.go
- ipc_log.go
- ipc_manager.go
- ipc_message.go
- ipc_response.go
- log.go
- log_custom.go
- renderer.go
- renderer_headless.go
- renderer_webview.go
- runtime.go
- runtime_browser.go
- runtime_dialog.go
- runtime_events.go
- runtime_filesystem.go
- runtime_log.go
- runtime_window.go
- utils.go
- wails-mewn.go