go-selfupdate

command module
v0.0.0-...-c2f128a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2014 License: MIT Imports: 10 Imported by: 0

README

go-selfupdate

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.yourdownmain.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}}",

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/bitbucket.org/kardianos/osext
Extensions to the standard "os" package.
Extensions to the standard "os" package.
_workspace/src/github.com/inconshreveable/go-update
Package update allows a program to "self-update", replacing its executable file with new bytes.
Package update allows a program to "self-update", replacing its executable file with new bytes.
_workspace/src/github.com/kr/binarydist
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
Godeps/_workspace/src/bitbucket.org/kardianos/osext
Extensions to the standard "os" package.
Extensions to the standard "os" package.
Godeps/_workspace/src/github.com/inconshreveable/go-update
Package update allows a program to "self-update", replacing its executable file with new bytes.
Package update allows a program to "self-update", replacing its executable file with new bytes.
Godeps/_workspace/src/github.com/kr/binarydist
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL