Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUpToDate reports that no pending release exists. ErrUpToDate = errors.New("already up to date") // ErrSuperseded reports that the requested version is no longer the // newest pending release. Callers should re-check and show the fresh // release notes instead of installing something the user never saw. ErrSuperseded = errors.New("a newer release is available") )
Functions ¶
This section is empty.
Types ¶
type FeedFormat ¶
type FeedFormat struct {
// contains filtered or unexported fields
}
FeedFormat is one release feed dialect. It dresses the request the way the feed wants it and maps the feed's JSON onto the neutral release model. Everything past that point, semver ordering, pending, checksums, download, swap, smoke test and notes rendering, is the same for every dialect.
func ParseFeedFormat ¶
func ParseFeedFormat(name string) (FeedFormat, error)
ParseFeedFormat resolves the updateFeedFormat build flag. An unknown value is a build configuration error and refuses loudly: a silent fallback would read the feed with the wrong mapping and report no update forever.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func New ¶
func New(current, feedURL string, format FeedFormat, dev bool) (*Updater, error)
New builds the updater for the running binary. feedURL is the release feed exactly as injected at build time, nothing here derives a URL from anything. format is the feed's dialect from ParseFeedFormat, and dev says whether this is a dev build, the only build the env override reaches, see resolveFeedURL.