Documentation
¶
Overview ¶
Package unattended implements a simple update package for Go
Index ¶
- type Target
- type Unattended
- func (updater *Unattended) ApplyUpdates() (bool, error)
- func (updater *Unattended) DownloadAndVerifyPackage(manifest omaha.Manifest, tempPath string) (string, error)
- func (updater *Unattended) GetLatestVersion() string
- func (updater *Unattended) Restart() error
- func (updater *Unattended) Run() error
- func (updater *Unattended) RunWithoutUpdate() error
- func (updater *Unattended) SetOutputWriter(writer io.Writer)
- func (updater *Unattended) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Target ¶
type Target struct {
// AppID is the unique ID of the application to use in checking for updates
AppID string
// UpdateEndpoint is the Unattended server endpoint serving updates
UpdateEndpoint string
// UpdateChannel defines the update channel, can be 'stable', 'beta' or any
// other value defined by the Unattended server
UpdateChannel string
// VersionsPath is the base path to where the versioned directories were
// installed to
VersionsPath string
// ApplicationName is the name of the executable to run
ApplicationName string
// ApplicationParameters to use in executing the target
ApplicationParameters []string
}
Target defines the target application to be controlled and updated by Unattended
func (*Target) LatestVersion ¶
LatestVersion returns the latest version installed of the target
type Unattended ¶
type Unattended struct {
// contains filtered or unexported fields
}
Unattended implements the core functionality of the package. It takes ownership of running and updating a target application
func New ¶
func New( clientID string, target Target, updateCheckInterval time.Duration, log *logrus.Entry) (*Unattended, error)
New creates a new instance of the unattended updater
func (*Unattended) ApplyUpdates ¶
func (updater *Unattended) ApplyUpdates() (bool, error)
ApplyUpdates downloads and applies downloads if they are available
func (*Unattended) DownloadAndVerifyPackage ¶
func (updater *Unattended) DownloadAndVerifyPackage( manifest omaha.Manifest, tempPath string) (string, error)
DownloadAndVerifyPackage downloads and verifies the package from the given manifest and returns the downloaded location
func (*Unattended) GetLatestVersion ¶
func (updater *Unattended) GetLatestVersion() string
GetLatestVersion returns the latest installed version
func (*Unattended) Restart ¶
func (updater *Unattended) Restart() error
Restart the target application
func (*Unattended) Run ¶
func (updater *Unattended) Run() error
Run starts the target application and the update check loop.
If any updates are found for targets in UpdateManifests they will be downloaded, applied and the target application restarted
func (*Unattended) RunWithoutUpdate ¶
func (updater *Unattended) RunWithoutUpdate() error
RunWithoutUpdate starts the target application without checking for updates
func (*Unattended) SetOutputWriter ¶
func (updater *Unattended) SetOutputWriter(writer io.Writer)
SetOutputWriter sets the writer to write the target's output to
Directories
¶
| Path | Synopsis |
|---|---|
|
Package main implements a simple sample of the unattended package
|
Package main implements a simple sample of the unattended package |
|
Package omaha implements a subset of the Google Omaha update protocol https://github.com/google/omaha
|
Package omaha implements a subset of the Google Omaha update protocol https://github.com/google/omaha |