Documentation
¶
Overview ¶
Package update provides an updater for AdGuardHome.
Index ¶
Constants ¶
const MaxPackageFileSize = 32 * 1024 * 1024
MaxPackageFileSize is a maximum package file length in bytes. The largest package whose size is limited by this constant currently has the size of approximately 9 MiB.
const MaxResponseSize = 64 * 1024
MaxResponseSize is responses on server's requests maximum length in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Client *http.Client VersionURL string // version.json URL VersionString string OS string // GOOS Arch string // GOARCH ARMVersion string // ARM version, e.g. "6" NewVersion string // VersionInfo.NewVersion PackageURL string // VersionInfo.PackageURL ConfigName string // current config file ".../AdGuardHome.yaml" WorkDir string // updater work dir (where backup/upd dirs will be created) }
Config - updater config
type Updater ¶
type Updater struct { Config // Updater configuration // contains filtered or unexported fields }
Updater - Updater
func NewUpdater ¶
NewUpdater - creates a new instance of the Updater
func (*Updater) DoUpdate ¶
DoUpdate - conducts the auto-update 1. Downloads the update file 2. Unpacks it and checks the contents 3. Backups the current version and configuration 4. Replaces the old files
func (*Updater) GetVersionResponse ¶
func (u *Updater) GetVersionResponse(forceRecheck bool) (VersionInfo, error)
GetVersionResponse - downloads version.json (if needed) and deserializes it
type VersionInfo ¶
type VersionInfo struct { NewVersion string // New version string Announcement string // Announcement text AnnouncementURL string // Announcement URL SelfUpdateMinVersion string // Min version starting with which we can auto-update CanAutoUpdate bool // If true - we can auto-update }
VersionInfo - VersionInfo