update

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AtlasNoUpdateNotifier when enabled it cancels checking for update
	AtlasNoUpdateNotifier = "ATLAS_NO_UPDATE_NOTIFIER"
)

Variables

This section is empty.

Functions

func Check

func Check(version string, logF func(i ...any))

Check implements a notification to the user when a later release is available 1. Check release file ~/.atlas/release.json for latest known release and poll time 2. If last poll was more than 24h, poll GitHub public API https://docs.github.com/en/rest/reference/releases#get-the-latest-release 3. Store the latest release metadata 4. If current build Version, that is not development, is lower than the latest release, notify user

Types

type LatestRelease

type LatestRelease struct {
	Version string `json:"tag_name"`
	URL     string `json:"html_url"`
}

LatestRelease holds the required fields from https://api.github.com/repos/ariga/atlas/releases/latest.

type Store

type Store struct {
	Version   string    `json:"version"`
	URL       string    `json:"url"`
	CheckedAt time.Time `json:"checkedat"`
}

Store is where the latest release data is stored on CLI host.

Jump to

Keyboard shortcuts

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