wails

package module
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2019 License: MIT Imports: 19 Imported by: 64

README

Coming Soon

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildMode = cmd.BuildModeProd

BuildMode indicates what mode we are in

Functions

This section is empty.

Types

type App

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

App defines the main application struct

func CreateApp

func CreateApp(optionalConfig ...*AppConfig) *App

CreateApp creates the application window with the given configuration If none given, the defaults are used

func (*App) AddCSS

func (a *App) AddCSS(js string)

AddCSS adds a CSS string to a cache that gets injected at runtime

func (*App) AddJS

func (a *App) AddJS(js string)

AddJS adds a piece of Javascript to a cache that gets injected at runtime

func (*App) Bind

func (a *App) Bind(object interface{})

Bind allows the user to bind the given object with the application

func (*App) Run

func (a *App) Run() error

Run the app

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) Debug

func (c *CustomLogger) Debug(message string)

Debug level message

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) Error

func (c *CustomLogger) Error(message string)

Error level 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) Fatal

func (c *CustomLogger) Fatal(message string)

Fatal level 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) Info

func (c *CustomLogger) Info(message string)

Info level 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) Panic

func (c *CustomLogger) Panic(message string)

Panic level 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) Warn

func (c *CustomLogger) Warn(message string)

Warn level 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) AddCSSList

func (h *Headless) AddCSSList(cssCache []string)

AddCSSList adds a slice of CSS strings to the list of css files injected at startup

func (*Headless) AddJSList

func (h *Headless) AddJSList(jsCache []string)

AddJSList adds a slice of JS strings to the list of js files injected at startup

func (*Headless) Callback

func (h *Headless) Callback(data string) error

Callback sends a callback to the frontend

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

func (h *Headless) NewBinding(methodName string) error

NewBinding creates a new binding with the frontend

func (*Headless) NotifyEvent

func (h *Headless) NotifyEvent(event *eventData) error

NotifyEvent notifies the frontend of an event

func (*Headless) Run

func (h *Headless) Run() error

Run the app in headless mode!

func (*Headless) SelectDirectory

func (h *Headless) SelectDirectory() string

SelectDirectory is unsupported for Headless but required for the Renderer interface

func (*Headless) SelectFile

func (h *Headless) SelectFile() string

SelectFile is unsupported for Headless but required for the Renderer interface

func (*Headless) SelectSaveFile

func (h *Headless) SelectSaveFile() string

SelectSaveFile is unsupported for Headless but required for the Renderer interface

func (*Headless) SetColour

func (h *Headless) SetColour(colour string) error

SetColour is unsupported for Headless but required for the Renderer interface

func (*Headless) SetTitle

func (h *Headless) SetTitle(title string)

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

	// Injection
	AddJSList(js []string)
	AddCSSList(css []string)

	// 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
}

Runtime is the Wails Runtime Interface, given to a user who has defined the WailsInit method

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 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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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