cef | ||
cmd | ||
common | ||
consts | ||
decimal | ||
example | ||
ipc | ||
logger | ||
.gitattributes | ||
.gitignore | ||
go.mod | ||
go.sum | ||
LICENSE | ||
README.md | ||
README.zh_CN.md |
Energy is Go's framework for building desktop applications based on CEF
中文 | English
Introduction
Energy Is a framework for building desktop applications using JavaScript,HTML, and CSS based on Golcl and CEF4Delphi Pure Go language development framework, embedded Chromium CEF binary
Allows you to use Web front-end technology to build cross-platform applications on Windows, Linux, and MacOS
You can use the Energy and Golcl to build compact system UI cross-platform application separately
Supports Windows_32, 64 bits, Linux_x86_64 bits, MacOS_x86_64 bits
In Go and Web technologies, based on IPC communication, you can easily interact data, function calls, and event calls between Go and Web without the need for a Web Service interface, just as easily as calling functions in the language itself
In Go, you can also define JS variables, which can be used by Web end JS to realize Go variable or structure object data synchronization
Call JS function and JS event listener in Go to realize functional interaction between GO and JS
Call Go function in JS, listen to events of Go, and realize functional interaction between JS and GO
Installation Environment
Install it automatically using the energy command line tool
go get github.com/energye/energy
cd energy/cmd/energy
go install
energy install .
Getting started guide
Quick start
Basic needs
golang >= 1.9.2
Use the energy command line tool to automatically install environment dependencies
Configure the ENERGY_HOME environment variable, ENERGY_HOME= framework root
Example/simple example
go mod tidy
IDE run simple
Currently, the command line tools do not support packaged applications, Windows you can use (MSI or Inno Setup) and other green packaging tools, Deb installation package in Linux, MacOS generates. App packages by default or custom. App packages
example/simple code
package main
import (
"github.com/energye/energy/cef"
)
func main() {
//Global initialization, which every application must call
cef.GlobalCEFInit(nil, nil)
//Creating an Application
cefApp := cef.NewApplication(nil)
//Specify a URL address, or a local html file directory
cef.BrowserWindow.Config.DefaultUrl = "https://energy.yanghy.cn"
//Running the Application
cef.Run(cefApp)
}