Documentation
¶
Overview ¶
Package update downloads and replaces the Mihari binary (self-update).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
URL string `json:"browser_download_url"`
Size int64 `json:"size"`
}
Asset is a GitHub release asset.
type CheckResult ¶ added in v0.4.0
CheckResult describes the latest Mihari release relative to the running version.
type SelfUpdater ¶
type SelfUpdater struct {
HTTPClient *http.Client
APIBase string
Repository string
GOOS string
GOARCH string
// AfterReplace is optional; used to restart the OS service after a successful replace.
AfterReplace func(ctx context.Context, version string) error
}
SelfUpdater installs a newer Mihari binary from GitHub Releases.
func (SelfUpdater) Check ¶ added in v0.4.0
func (u SelfUpdater) Check(ctx context.Context, currentVersion string) (CheckResult, error)
Check reports whether GitHub Releases contains a different Mihari version.