Electron UI for Golang Program?

27,495

Solution 1

The interaction of an application written in electron with its backend is exactly like a Web browser, therefore you have the same options (Web Api, Web Sockets, Ajax, etc.)

Solution 2

You can use go-astilectron it allows you to build cross-platform GUI apps with GO and HTML/JS/CSS (powered by Electron) (disclosure: I'm the author)

Solution 3

You can execute your command line app from your Electron app via child_process.spawn and communicate with it via stdin/stdout.

Solution 4

Murlock Is an Electron wrapper for Golang to make it easy for this kind of app for Mac. They're working on Windows and looking for contributions for the other platforms.

Solution 5

Similarly to Murlock, may I dare to suggest Webview library. It's a thin wrapper over Webkit and MSHTML that runs on Windows 7+, MacOS, Linux and OpenBSD.

It is much smaller and easier than Electron. Also the resulting apps are smaller and less memory-hungry.

You may have a look at https://github.com/zserge/webview/tree/master/examples/todo-go for a Todo app example that compiles into a small standalone binary.

Share:
27,495

Related videos on Youtube

Ashkay
Author by

Ashkay

Math is bae woooo.

Updated on May 19, 2021

Comments

  • Ashkay
    Ashkay about 3 years

    I'd like to make a GUI in Electron for a Desktop Application written in Go (currently it's a command line tool).

    What's the convention for communicating between the Electron and Go processes?

    Would simply using the Go binary as an API work? Some sort of websocket communication?

  • Ashkay
    Ashkay about 8 years
    I decided to use github.com/googollee/go-socket.io for the backend, and normal socket.io on the frontend. Thanks!
  • roeland
    roeland about 7 years
    Nice project, but I don't think it is a wrapper for Electron. The mac version uses WebKit. The windows version uses EdgeHTML.
  • Pioz
    Pioz almost 7 years
    Murlock is not a Electron wrapper. It's simply a Go package to build UI with html and css. But it looks like a very interesting project!
  • Per Svensson
    Per Svensson about 4 years
    But worth mentioning... Ultralight has a very aggressive pricing model for anything above "indie" developers. "While muon itself is MIT licensed, Ultralight is not."
  • Danny
    Danny almost 3 years
    For anyone looking at this in 2021, Muon has stopped maintaining since 2019.