Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

maneac/go-ultralight

Repository files navigation

Go Report Card GoDoc Build Status codecov

Go-Ultralight

Please read the installation instructions below

Go-Ultralight provides unofficial bindings for the Ultralight UI library, endeavouring to match the original API as closely as possible. This project borrows heavily from the wonderful work of Raff found here.

What is Ultralight?

Ultralight (https://ultralig.ht) is a HTML UI library, written in C++, that provides a performant and lightweight alternative to Electron, with JavaScript support.

Licensing

While this wrapper is open-source, the Ultralight project is not. Use of the binaries downloaded either manually or using the tool must be in accordance with their licensing terms. Usage is free for non-commercial applications, with the full pricing hierarchy available on the website linked below:

https://ultralig.ht/#pricing

Installation

Prerequisites

You must have a working CGo installation and have the GOPATH set.

All Methods

  1. Run:

    go get -d github.com/maneac/go-ultralight/...

    to download the project and the installation and setup utility. Then, install the optional utility:

    go install github.com/maneac/go-ultralight/go-ultralight

Automated

  1. Navigate to your project's directory and execute:

    go-ultralight [OPTIONS]

    to automatically download the Ultralight SDK and copy the necessary binaries for running your application. For more information on the available options, please read the utility's help (go-ultralight --help).
  2. That's it! Now you're ready to Go-Ultralight!

Manual

  1. Download the Ultralight SDK for your system from https://ultralig.ht.

  2. Locate your installation of Go-Ultralight (typically in $GOPATH/src/github.com/maneac/go-ultralight or $GOPATH/pkg/mod/github.com/maneac/go-ultralight), and extract the Ultralight SDK into an 'SDK' folder inside. Example structure:

    github.com
      |-maneac
        |-go-ultralight
          |-go-ultralight
          |-examples
          |-SDK
       	    |-bin
                |-AppCore.dll
                |-AppCore.dylib
       	        |-libAppCore.so
                |-...
            |-deps
            |-include
            ...
    
  3. Copy the binary files (*.dylib, *.dll, *.so) for your target system type from the 'SDK/bin' folder into your project directory. Example project directory:

    exampleProject
      |-AppCore.dll
      |-main.go
      |-Ultralight.dll
      |-UltralightCore.dll
      |-WebCore.dll
    

Use

If you are a non-Windows user, run the following to enable detection of the binaries:

export CGO_LDFLAGS_ALLOW=-Wl,-rpath.*

After installation, use the setup utility go-ultralight , or follow step 4 of the manual installation to copy the necessary binary files to your project directory. These files are required to run the compiled program.

Please build your project with go build instead of using go run, as run has been known to cause issues with the Browser example.

For examples, please see the 'examples' directory, which contains Go implementations of the sample projects provided with the Ultralight SDK.

To Do

  • Add support for inspector view
  • Write tests

Last updated: 17/05/2020