Coder Social home page Coder Social logo

go-selfupdate's Introduction

go-selfupdate

GoDoc Build Status

Enable your Golang applications to self update. Inspired by Chrome based on Heroku's hk.

Features

  • Tested on Mac, Linux, Arm, and Windows
  • Creates binary diffs with bsdiff allowing small incremental updates
  • Falls back to full binary update if diff fails to match SHA

QuickStart

Enable your App to Self Update

var updater = &selfupdate.Updater{
	CurrentVersion: version,
	ApiURL:         "http://updates.yourdomain.com/",
	BinURL:         "http://updates.yourdomain.com/",
	DiffURL:        "http://updates.yourdomain.com/",
	Dir:            "update/",
	CmdName:        "myapp", // app name
}

if updater != nil {
	go updater.BackgroundRun()
}

Push Out and Update

go-selfupdate myapp 1.2

This will create a folder in your project called, public you can then rsync or transfer this to your webserver or S3.

If you are cross compiling you can specify a directory:

go-selfupdate /tmp/mybinares/ 1.2

The directory should contain files with the name, $GOOS-$ARCH. Example:

windows-386
darwin-amd64
linux-arm

If you are using goxc you can output the files with this naming format by specifying this config:

"OutPath": "{{.Dest}}{{.PS}}{{.Version}}{{.PS}}{{.Os}}-{{.Arch}}",

go-selfupdate's People

Contributors

sanbornm avatar thomasf avatar nickethier avatar bobzoller avatar deinspanjer avatar luzifer avatar ibnesayeed avatar chrisprobinson avatar

Watchers

twkun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.