Documentation
¶
Overview ¶
Package version reports the running build version and checks GitHub for a newer release. Development builds (a prerelease or non-semver version) never reach the network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker resolves the latest release, caching the result to avoid hammering the GitHub API (unauthenticated: 60 req/h). It is safe for concurrent use.
func NewChecker ¶
NewChecker returns a checker for the given build version. When enabled is false the remote check is skipped and only the local version is reported.
type Info ¶
type Info struct {
Current string `json:"current"`
Dev bool `json:"dev"`
Latest string `json:"latest,omitempty"`
UpdateAvailable bool `json:"updateAvailable"`
ReleaseURL string `json:"releaseUrl,omitempty"`
CheckDisabled bool `json:"checkDisabled,omitempty"`
CheckedAt *time.Time `json:"checkedAt,omitempty"`
Error string `json:"error,omitempty"`
}
Info is the version/update status returned to clients.
Click to show internal directories.
Click to hide internal directories.