Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ChromeExecutable = LocateChrome
ChromeExecutable returns a string which points to the preferred Chrome executable file.
Functions ¶
func Embed ¶
Embed is a helper function that embeds assets from the given directories into a Go source file. It is designed to be called from some generator script, see example project to find out how it can be used.
func LocateChrome ¶
func LocateChrome() string
LocateChrome returns a path to the Chrome binary, or an empty string if Chrome installation is not found.
func PromptDownload ¶
func PromptDownload()
PromptDownload asks user if he wants to download and install Chrome, and opens a download web page if the user agrees.
Types ¶
type Bounds ¶ added in v0.1.3
type Bounds struct { Left int `json:"left"` Top int `json:"top"` Width int `json:"width"` Height int `json:"height"` WindowState WindowState `json:"windowState"` }
Bounds defines settable window properties.
type UI ¶
type UI interface { Load(url string) error Bounds() (Bounds, error) SetBounds(Bounds) error Bind(name string, f interface{}) error Eval(js string) Value Done() <-chan struct{} Close() error }
UI interface allows talking to the HTML5 UI from Go.
func New ¶
New returns a new HTML5 UI for the given URL, user profile directory, window size and other options passed to the browser engine. If URL is an empty string - a blank page is displayed. If user profile directory is an empty string - a temporary directory is created and it will be removed on ui.Close(). You might want to use "--headless" custom CLI argument to test your UI code.
type Value ¶
type Value interface { Err() error To(interface{}) error Float() float32 Int() int String() string Bool() bool Object() map[string]Value Array() []Value }
Value is a generic type of a JSON value (primitive, object, array) and optionally an error value.
type WindowState ¶ added in v0.1.3
type WindowState string
WindowState defines the state of the Chrome window, possible values are "normal", "maximized", "minimized" and "fullscreen".
const ( // WindowStateNormal defines a normal state of the browser window WindowStateNormal WindowState = "normal" // WindowStateMaximized defines a maximized state of the browser window WindowStateMaximized WindowState = "maximized" // WindowStateMinimized defines a minimized state of the browser window WindowStateMinimized WindowState = "minimized" // WindowStateFullscreen defines a fullscreen state of the browser window WindowStateFullscreen WindowState = "fullscreen" )