selfupdate

package
v14.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package selfupdate provides methods and structs for application self-update

Index

Constants

View Source
const (
	// EV_UPDATE_START is the event name for the start of the update process
	EV_UPDATE_START = "update.start"

	// EV_UPDATE_COMPLETE is the event name for successful completion of the update
	EV_UPDATE_COMPLETE = "update.complete"

	// EV_UPDATE_ERROR is the event name for any error during the update
	EV_UPDATE_ERROR = "update.error"

	// EV_SIGNATURE_DOWNLOAD_START is the event name for starting signature download
	EV_SIGNATURE_DOWNLOAD_START = "signature.download.start"

	// EV_SIGNATURE_DOWNLOAD_ERROR is the event name for signature download errors
	EV_SIGNATURE_DOWNLOAD_ERROR = "signature.download.error"

	// EV_SIGNATURE_DOWNLOAD_COMPLETE is the event name for completed signature download
	EV_SIGNATURE_DOWNLOAD_COMPLETE = "signature.download.complete"

	// EV_SIGNATURE_PARSE_START is the event name for starting signature parsing
	EV_SIGNATURE_PARSE_START = "signature.parse.start"

	// EV_SIGNATURE_PARSE_ERROR is the event name for signature parsing errors
	EV_SIGNATURE_PARSE_ERROR = "signature.parse.error"

	// EV_SIGNATURE_PARSE_COMPLETE is the event name for completed signature parsing
	EV_SIGNATURE_PARSE_COMPLETE = "signature.parse.complete"

	// EV_BINARY_DOWNLOAD_START is the event name for starting binary download
	EV_BINARY_DOWNLOAD_START = "binary.download.start"

	// EV_BINARY_DOWNLOAD_SIZE is the event name for reporting binary download size
	EV_BINARY_DOWNLOAD_SIZE = "binary.download.size"

	// EV_BINARY_DOWNLOAD_ERROR is the event name for binary download errors
	EV_BINARY_DOWNLOAD_ERROR = "binary.download.error"

	// EV_BINARY_DOWNLOAD_COMPLETE is the event name for completed binary download
	EV_BINARY_DOWNLOAD_COMPLETE = "binary.download.complete"

	// EV_BINARY_VERIFY_START is the event name for starting binary signature verification
	EV_BINARY_VERIFY_START = "binary.verify.start"

	// EV_BINARY_VERIFY_ERROR is the event name for binary signature verification errors
	EV_BINARY_VERIFY_ERROR = "binary.verify.error"

	// EV_BINARY_VERIFY_OK is the event name for successful binary signature verification
	EV_BINARY_VERIFY_OK = "binary.verify.ok"

	// EV_BINARY_REPLACE_START is the event name for starting binary replacement
	EV_BINARY_REPLACE_START = "binary.replace.start"

	// EV_BINARY_REPLACE_ERROR is the event name for binary replacement errors
	EV_BINARY_REPLACE_ERROR = "binary.replace.error"

	// EV_BINARY_REPLACE_COMPLETE is the event name for completed binary replacement
	EV_BINARY_REPLACE_COMPLETE = "binary.replace.complete"
)

Variables

View Source
var (
	// ErrEmptyPubKey indicates that the provided public key data is empty
	ErrEmptyPubKey = fmt.Errorf("public key is empty")

	// ErrNoSignature indicates that no signature data or URL was provided in update info
	ErrNoSignature = fmt.Errorf("update info has no signature")

	// ErrNoBinaryURL indicates that the update info does not contain a binary URL
	ErrNoBinaryURL = fmt.Errorf("update info has no binary URL")

	// ErrNoVersion indicates that the update info does not contain a version
	ErrNoVersion = fmt.Errorf("update info has no version")
)

Functions

func Run

func Run(info Update, pubKeyData string, dispatcher *events.Dispatcher) error

Run executes the self-update process using the given update info and public key

Types

type Update

type Update struct {
	BinaryURL    string // BinaryURL is the URL of the new binary
	SignatureURL string // SignatureURL is the URL of the signature file
	Version      string // Version is the version of the new binary
	Signature    []byte // Signature contains the raw signature data
}

Update holds information about a pending update including URLs and signature

func (Update) Validate

func (i Update) Validate() error

Validate checks that the update struct contains all required fields

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL