tuna

package module
v0.0.0-...-c59e438 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: AGPL-3.0 Imports: 7 Imported by: 1

README

tuna

logo Simple yet functional self updater written in GO.

Functionality

It will update itself with the latest release from the given URL by deleting the old binary and downloading the new one in its place.

Example
package main

import (
	"github.com/8ff/tuna"
)

func main() {
	// Determine OS and ARCH
	osRelease := runtime.GOOS
	arch := runtime.GOARCH

	// Build URL
	e := tuna.SelfUpdate(fmt.Sprintf("https://github.com/myuser/myapp/releases/download/latest/myapp.%s.%s", osRelease, arch))
	if e != nil {
		log.Fatal(e.Error())
	} else {
		log.Println("Updated successfully!")
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersion

func GetVersion(versionParam string) ([]byte, error)

func SelfUpdate

func SelfUpdate(url string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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