selfupdate

package
v0.0.0-...-31017a7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handler = http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
	rw.Header().Set("content-type", "text/plain")

	if mostRecentFailure != nil {
		fmt.Fprintf(rw, "update failure: %s\n\n", mostRecentFailure)
	}

	if invalidToken {
		fmt.Fprintf(rw, "token is invalid, only updating hourly\n\n")
	}

	version.Render(rw)
})

Functions

func AutoUpdate

func AutoUpdate()

AutoUpdate will periodically check for an update (a little over hourly) and install it unless the LM_DISABLE_SELFUPDATE env var is set. If the LM_GH_TOKEN environment variable is set this will check more often (closer to every minute.) The Token should have public_repo access. The token should include the `Basic ` prefix.

func MaybeUpdate

func MaybeUpdate()

MaybeUpdate will check for an update and install it immediately. If the LM_GH_TOKEN environment variable is set, it will be treated as a github personal access token, instead of anonymous access.

Types

This section is empty.

Jump to

Keyboard shortcuts

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