Documentation
¶
Index ¶
- func Check(url string, allowedSigners []TrustedSigner, productId string, ...) (pkg *Package, ver *Version, err error)
- func DownloadAndInstall(urls []string, hash *Hash, installerArguments string, ctx context.Context, ...) error
- type AlgorithmMask
- type Hash
- type Package
- type TrustedSigner
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
func Check(url string, allowedSigners []TrustedSigner, productId string, ctx context.Context) (pkg *Package, ver *Version, err error)
Check locates latest version available from url discovery resource and version of the product installed.
func DownloadAndInstall ¶
func DownloadAndInstall(urls []string, hash *Hash, installerArguments string, ctx context.Context, progress progress.ProgressIndicator) error
DownloadAndInstall securely downloads installer file, prepares and launches installer
Types ¶
type AlgorithmMask ¶
type AlgorithmMask int
Bitmask of signing algorithms
const ( LegacyAlgorithm AlgorithmMask = 1 << iota // BLAKE2b EdDSA PrehashedAlgorithm // BLAKE2b-prehashed EdDSA AnyAlgorithm = LegacyAlgorithm | PrehashedAlgorithm )
type Hash ¶
type Hash [32]byte
SHA-256 hash
func (*Hash) MarshalJSON ¶
MarshalJSON hexadecimal-encodes SHA-256 hash value.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON hexadecimal-decodes SHA-256 hash value.
type Package ¶
type Package struct {
Arguments string `json:"arguments"` // Update file command line arguments
Uris []string `json:"uri"` // List of update file download URIs
Version *Version `json:"version"` // Available product version
ChangelogUri string `json:"changelog_uri"` // Product changelog URI
Hash Hash `json:"hash-sha256"` // Update file SHA-256 hash
}
Available self-update description
type TrustedSigner ¶
type TrustedSigner struct {
PublicKey minisign.PublicKey // Public key of the trusted signer
AlgorithmMask AlgorithmMask // Bitmask of algorithms trusted signer is using to sign content
}
Who and how is the signer we trust
type Version ¶
type Version [4]uint
Product/file version
func ParseVersion ¶
ParseVersion parses n.n.n.n version string into components.
func (*Version) IsOlderOrEqual ¶
IsOlderOrEqual returns true if v <= other
func (*Version) MarshalJSON ¶
MarshalJSON encodes "n.n.n.n" version.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON decodes "n.n.n.n" version.
Click to show internal directories.
Click to hide internal directories.