Build desktop applications using Go and Web technologies

Build desktop applications using Go and Web technologies

2022-10-31 0 834
Resource Number 47245 Last Updated 2025-02-21
¥ 0USD Upgrade VIP
Download Now Matters needing attention
Can't download? Please contact customer service to submit a link error!
Value-added Service: Installation Guide Environment Configuration Secondary Development Template Modification Source Code Installation

This issue features WAILS, a project that uses Go and Web technologies to build desktop applications.

Build desktop applications using Go and Web technologies插图

Wails is a framework that helps you write desktop applications using Go and Web technologies. For the front end, use the Webview library. However, it uses the platform’s native rendering engine (currently Webkit for Linux and Mac, MSHTML for Windows). The front end is coded in HTML/Javascript/CSS, and the back end is pure Go. Through the binding mechanism, Go code can be exposed to the front end as a function that returns promises. The project compiles to a single executable file into which all resources are bundled. On Windows and MacOS, binaries can be bundled into platform-specific packages for distribution.

Note: The rendering engine is a WebView, not a bundled Web browser, so some “browser apis” will not be available for your application, such as localstorage. Most applications don’t need to use them, and if you still want to, you can use Go for most things.

Function

  • Go
  • Build UI interfaces with any front-end technology
  • Quickly generate Vue, Vuetify, React front-end code for your Go app
  • Expose the Go method to the front end with a simple bind command
  • Using native rendering engine – no embedded browser
  • Shared Event system
  • Native File system dialog
  • Powerful command line tools
  • Across multiple platforms

Overview

  • Wails

Wails is designed to minimize the differences between web technologies and Go. The front end is a Webview component, and you can use any common Javascript framework you like to develop the front end code and interact with the Go code inside. This is achieved through a shared IPC mechanism.

Build desktop applications using Go and Web technologies插图1

  • IPC Overview

The IPC mechanism can run in two runtimes, one running in Javascript and one running in Go. They all provide a simple interface that relieves developers of the burden of dealing directly with IPC mechanisms.

Build desktop applications using Go and Web technologies插图2

The runtime shares common components that developers can interact with: bindings and events.

Build desktop applications using Go and Web technologies插图3

  • Binding

The Wails application provides a way for you to (bind) exposed Go code to the front end. Using this method, you can bind any function or exposed structural method. At startup, Wails analyzes the bound functions/methods and automatically provides the equivalent functions in Javascript. Enables you to call the bound Go code directly from Javascript.

Build desktop applications using Go and Web technologies插图4

JavaScript wrap functions that handle all the complexity of calling Go code. You simply call the function using Javascript and receive a Promise. The binding Go code functionality handles all the complexity of the binding. If the call to the Go code completes successfully, the result is passed to the resolve function. If an error is returned, it is passed to the reject function.

  • Event

Wails provides a unified event system, similar to Javascript’s native event system. This means that any event sent from Go or Javascript can be received by either party. Data can be passed along with any event. In this way, you can do simple things like let the background process run in Go and tell the front end to update the page.

Build desktop applications using Go and Web technologies插图5

Installation

  • Installation command

The installation process is very simple, just run the following command:

go get -u  github.com/wailsapp/wails/cmd/wails

After installation, the “wails update” command can be used for subsequent updates.

To get the latest pre-release with the latest features you can attach the -pre tag after it: wails update-pre.

To complete the setup, run the installation command wails setup and fill in your name and email address.

  • Generate new project

Generate a new project using the initialization command wails init, select the default options.

  • Build

Switch to the project directory cd my-project and build your project using the build command build command wails build.

If all goes well, you should have a compiled program in your local directory. If using Windows, use./my-project to run it or double-click myproject.exe.

Build desktop applications using Go and Web technologies插图6

Project presentation

Build desktop applications using Go and Web technologies插图7WOMBAT

Build desktop applications using Go and Web technologies插图8

SURGE

Build desktop applications using Go and Web technologies插图9

MOLLY Purse

Build desktop applications using Go and Web technologies插图10

PORTFALL

Build desktop applications using Go and Web technologies插图11

RESTORIC

Build desktop applications using Go and Web technologies插图12

OPTIMUS Screenshot editor

—END—

Open Source protocol: MIT

资源下载此资源为免费资源立即下载
Telegram:@John_Software

Disclaimer: This article is published by a third party and represents the views of the author only and has nothing to do with this website. This site does not make any guarantee or commitment to the authenticity, completeness and timeliness of this article and all or part of its content, please readers for reference only, and please verify the relevant content. The publication or republication of articles by this website for the purpose of conveying more information does not mean that it endorses its views or confirms its description, nor does it mean that this website is responsible for its authenticity.

Ictcoder Free source code Build desktop applications using Go and Web technologies https://ictcoder.com/kyym/build-desktop-applications-using-go-and-web-technologies.html

Share free open-source source code

Q&A
  • 1, automatic: after taking the photo, click the (download) link to download; 2. Manual: After taking the photo, contact the seller to issue it or contact the official to find the developer to ship.
View details
  • 1, the default transaction cycle of the source code: manual delivery of goods for 1-3 days, and the user payment amount will enter the platform guarantee until the completion of the transaction or 3-7 days can be issued, in case of disputes indefinitely extend the collection amount until the dispute is resolved or refunded!
View details
  • 1. Heptalon will permanently archive the process of trading between the two parties and the snapshots of the traded goods to ensure that the transaction is true, effective and safe! 2, Seven PAWS can not guarantee such as "permanent package update", "permanent technical support" and other similar transactions after the merchant commitment, please identify the buyer; 3, in the source code at the same time there is a website demonstration and picture demonstration, and the site is inconsistent with the diagram, the default according to the diagram as the dispute evaluation basis (except for special statements or agreement); 4, in the absence of "no legitimate basis for refund", the commodity written "once sold, no support for refund" and other similar statements, shall be deemed invalid; 5, before the shooting, the transaction content agreed by the two parties on QQ can also be the basis for dispute judgment (agreement and description of the conflict, the agreement shall prevail); 6, because the chat record can be used as the basis for dispute judgment, so when the two sides contact, only communicate with the other party on the QQ and mobile phone number left on the systemhere, in case the other party does not recognize self-commitment. 7, although the probability of disputes is very small, but be sure to retain such important information as chat records, mobile phone messages, etc., in case of disputes, it is convenient for seven PAWS to intervene in rapid processing.
View details
  • 1. As a third-party intermediary platform, Qichou protects the security of the transaction and the rights and interests of both buyers and sellers according to the transaction contract (commodity description, content agreed before the transaction); 2, non-platform online trading projects, any consequences have nothing to do with mutual site; No matter the seller for any reason to require offline transactions, please contact the management report.
View details

Related Article

make a comment
No comments available at the moment
Official customer service team

To solve your worries - 24 hours online professional service