Skip to content

Cross Platform Packages

Alex Flint edited this page Jan 27, 2017 · 5 revisions

Packages

We need use some cross platform Golang Packages for some of the common functionality we need outside of the main Browser window.

Embedded assets

https://github.com/shurcooL/vfsgen

  • efficient one.
  • useful for the assets needed to be served inside the browser over http File system.
  • Also has links to all the other ones.

https://github.com/hyangah/mgodoc

  • Not of interest for desktop, but for mobile using webviews.
  • Its out of scope for now, but its perfectly possible that we can also support building apps for Android and IOS, with a Golang backend and a Web based GUI contained in a Webview.
  • The point is that it uses the golang.org/x/tools/godoc/vfs/zipfs like others, but does not return a reader, but instead a []byte to it can be used on mobile, whilst allow Golang templates etc.

Systems Paths

https://github.com/kardianos/osext

  • cross platform paths
  • Need to also get cross platform data folder that is independent of application upgrades.

Desktop notifications

https://github.com/getlantern/systray

  • cross platform
  • well supported as its a big project using it.

Packager / Installer

Some projects demand a proper installer for users to install the software.

The Golang library itself has a very nice installer. It uses golang with templates, etc This is a very good starting point, that can be used as a base. https://github.com/golang/build/tree/master/cmd/release

  • windows wix
  • osx pck
  • linux debian

Updater

Also you want to be able to do remote updates of the software too.

https://github.com/inconshreveable/go-update

  • simple and works

https://github.com/keybase/go-updater

  • complex and handles lots more edge cases.
  • should be well supported as Keybase is a heavy golang user.

Logging

https://github.com/kirillDanshin/dlog

  • compile-time enabling. saves release runtime performance by excluding any logging logic if it wasn't enabled in compile-time.
  • supports three modes: default, buffered (thread-safe) and WithCaller. the last shows where dlog functions was called from
  • allows to simply Dump any variables

Alternative Webviews

https://github.com/knq/chromedp https://github.com/sourcegraph/go-webkit2