Documentation
¶
Index ¶
- Constants
- Variables
- func GetDefaultKeyring() (*crypto.KeyRing, error)
- type Channel
- type Downloader
- type File
- type FileIdentifier
- type Installer
- type InstallerDefault
- type Release
- type ReleaseCategory
- type Updater
- func (u *Updater) GetVersionInfo(ctx context.Context, downloader Downloader) (VersionInfo, error)
- func (u *Updater) GetVersionInfoLegacy(ctx context.Context, downloader Downloader, channel Channel) (VersionInfoLegacy, error)
- func (u *Updater) InstallUpdate(ctx context.Context, downloader Downloader, release Release) error
- func (u *Updater) InstallUpdateLegacy(ctx context.Context, downloader Downloader, update VersionInfoLegacy) error
- func (u *Updater) RemoveOldUpdates() error
- type VersionInfo
- type VersionInfoLegacy
- type VersionMap
Constants ¶
View Source
const DefaultPublicKey = `` /* 9373-byte string literal not displayed */
DefaultPublicKey is the public key used to sign builds.
View Source
const Host = "https://proton.me/download"
Variables ¶
View Source
var ( ErrDownloadVerify = errors.New("failed to download or verify the update") ErrInstall = errors.New("failed to install the update") ErrUpdateAlreadyInstalled = errors.New("update is already installed") ErrVersionFileDownloadOrVerify = errors.New("failed to download or verify the version file") ErrReleaseUpdatePackageMissing = errors.New("release update package is missing") )
View Source
var DefaultUpdateChannel = StableChannel //nolint:gochecknoglobals
DefaultUpdateChannel is the default update channel to subscribe to. It is set to the stable channel by default, unless overridden at build time.
Functions ¶
func GetDefaultKeyring ¶ added in v3.2.0
Types ¶
type Downloader ¶
type File ¶ added in v3.18.0
type File struct { URL string `json:"Url"` Sha512CheckSum string `json:"Sha512CheckSum,omitempty"` Identifier FileIdentifier `json:"Identifier"` }
type FileIdentifier ¶ added in v3.18.0
type FileIdentifier uint8
const ( PackageIdentifier FileIdentifier = iota InstallerIdentifier )
func ParseFileIdentifier ¶ added in v3.18.0
func ParseFileIdentifier(s string) (FileIdentifier, error)
func (FileIdentifier) MarshalJSON ¶ added in v3.18.0
func (fi FileIdentifier) MarshalJSON() ([]byte, error)
func (FileIdentifier) String ¶ added in v3.18.0
func (fi FileIdentifier) String() string
func (*FileIdentifier) UnmarshalJSON ¶ added in v3.18.0
func (fi *FileIdentifier) UnmarshalJSON(data []byte) (err error)
type InstallerDefault ¶
type InstallerDefault struct {
// contains filtered or unexported fields
}
func NewInstaller ¶
func NewInstaller(versioner *versioner.Versioner) *InstallerDefault
func (*InstallerDefault) InstallUpdate ¶
func (i *InstallerDefault) InstallUpdate(version *semver.Version, r io.Reader) error
func (*InstallerDefault) IsAlreadyInstalled ¶
func (i *InstallerDefault) IsAlreadyInstalled(version *semver.Version) bool
type Release ¶ added in v3.18.0
type Release struct { ReleaseCategory ReleaseCategory `json:"CategoryName"` Version *semver.Version SystemVersion versioncompare.SystemVersion `json:"SystemVersion,omitempty"` RolloutProportion float64 MinAuto *semver.Version `json:"MinAuto,omitempty"` ReleaseNotesPage string LandingPage string File []File `json:"File"` }
type ReleaseCategory ¶ added in v3.18.0
type ReleaseCategory uint8
const ( EarlyAccessReleaseCategory ReleaseCategory = iota StableReleaseCategory )
func ParseReleaseCategory ¶ added in v3.18.0
func ParseReleaseCategory(s string) (ReleaseCategory, error)
func (ReleaseCategory) MarshalJSON ¶ added in v3.18.0
func (rc ReleaseCategory) MarshalJSON() ([]byte, error)
func (ReleaseCategory) String ¶ added in v3.18.0
func (rc ReleaseCategory) String() string
func (*ReleaseCategory) UnmarshalJSON ¶ added in v3.18.0
func (rc *ReleaseCategory) UnmarshalJSON(data []byte) (err error)
func (ReleaseCategory) UpdateEligible ¶ added in v3.18.0
func (rc ReleaseCategory) UpdateEligible(channel Channel) bool
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
func (*Updater) GetVersionInfo ¶
func (u *Updater) GetVersionInfo(ctx context.Context, downloader Downloader) (VersionInfo, error)
func (*Updater) GetVersionInfoLegacy ¶ added in v3.18.0
func (u *Updater) GetVersionInfoLegacy(ctx context.Context, downloader Downloader, channel Channel) (VersionInfoLegacy, error)
func (*Updater) InstallUpdate ¶
func (*Updater) InstallUpdateLegacy ¶ added in v3.18.0
func (u *Updater) InstallUpdateLegacy(ctx context.Context, downloader Downloader, update VersionInfoLegacy) error
func (*Updater) RemoveOldUpdates ¶ added in v3.7.0
type VersionInfo ¶
type VersionInfo struct {
Releases []Release `json:"Releases"`
}
type VersionInfoLegacy ¶ added in v3.18.0
type VersionInfoLegacy struct { // Version is the semantic version of the release. Version *semver.Version // MinAuto is the earliest version that is able to autoupdate to this version. // Apps older than this version must run the manual installer and cannot autoupdate. MinAuto *semver.Version // Package is the location of the update package. Package string // Installers are the locations of installer files (for manual installation). Installers []string // LandingPage is the address of the app landing page on proton.me LandingPage string // ReleaseNotesPage is the address of the page containing the release notes. ReleaseNotesPage string // RolloutProportion indicates the proportion (0,1] of users that should update to this version. RolloutProportion float64 }
VersionInfoLegacy is information about one version of the app.
func (VersionInfoLegacy) IsEmpty ¶ added in v3.18.0
func (verInfo VersionInfoLegacy) IsEmpty() bool
type VersionMap ¶
type VersionMap map[Channel]VersionInfoLegacy
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.