Documentation
¶
Overview ¶
Package gofront serves a frontend directory over HTTP and exposes bound Go methods to JavaScript (see App.Bind). Build an APK with the gofront CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AndroidAPI ¶ added in v0.4.0
type AndroidAPI struct {
// Addr is host:port of the Android bridge. Empty → env GOFRONT_ANDROID_ADDR
// or 127.0.0.1:8081.
Addr string
// contains filtered or unexported fields
}
AndroidAPI calls into the Android host process (MainActivity bridge). Use as app.AndroidAPI.Notify(...). Only works inside a gofront APK.
func (*AndroidAPI) Notify ¶ added in v0.4.0
func (a *AndroidAPI) Notify(title, text string) error
Notify shows a status-bar notification on the device.
type App ¶
type App struct {
Addr string // default 127.0.0.1:8080; override with -addr
FrontendDir string // default "frontend"; override with -frontend
// AndroidAPI calls Android host APIs (notifications, …) from Go.
AndroidAPI *AndroidAPI
// contains filtered or unexported fields
}
App is a local HTTP server plus a set of Go objects callable from JS.
func (*App) Bind ¶
Bind registers obj under name. Exported methods become window.gofront.<name>.<Method>(...).
func (*App) GenerateBindings ¶
GenerateBindings writes gofront.js and gofront.d.ts into dir.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gofront
command
Command gofront builds a Go + web project into an Android .apk.
|
Command gofront builds a Go + web project into an Android .apk. |
|
internal
|
|
|
apk
Package apk packs and signs an Android APK in pure Go (no Android SDK).
|
Package apk packs and signs an Android APK in pure Go (no Android SDK). |
|
assets
Package assets embeds prebuilt Android bootstrap files used by every APK.
|
Package assets embeds prebuilt Android bootstrap files used by every APK. |
Click to show internal directories.
Click to hide internal directories.