Documentation
¶
Overview ¶
Package omaha implements a subset of the Google Omaha update protocol https://github.com/google/omaha
Index ¶
Constants ¶
View Source
const ( // EventTypeUnknown is for unknown event types EventTypeUnknown string = "0" // EventTypeUpdateCheck is to check for update EventTypeUpdateCheck string = "1" // EventTypeDownload is for events regarding downloads EventTypeDownload string = "2" // EventTypeInstall is for events regarding installation EventTypeInstall string = "3" // EventTypeRollback is for events regarding rollback EventTypeRollback string = "4" // EventTypePing is for ping tests EventTypePing string = "800" )
View Source
const ( // EventResultTypeUnknown is for an unknown type EventResultTypeUnknown string = "0" // EventResultTypeNoUpdate is the result when no update is available EventResultTypeNoUpdate string = "1" // EventResultTypeAvailable the result when a new update is available EventResultTypeAvailable string = "2" // EventResultTypeSuccess is for operation success EventResultTypeSuccess string = "3" // EventResultTypeSuccessRestarted is for success and app restarted EventResultTypeSuccessRestarted string = "4" // EventResultTypeError is for operation failed EventResultTypeError string = "5" // EventResultTypeCancelled is for operation cancelled EventResultTypeCancelled string = "6" // EventResultTypeStarted is foro peration started EventResultTypeStarted string = "7" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
XMLName xml.Name `xml:"app"`
/// ID for the application
ID string `xml:"appid,attr"`
/// Status of the response
Status string `xml:"status,attr,omitempty"`
/// Version of the application in symver format
Version string `xml:"version,attr"`
/// Channel of the update, stable, beta, etc.
Channel string `xml:"track,attr"`
/// ClientID is the unique ID of the client
ClientID string `xml:"bootid,attr"`
/// Event being sent to the server
Event Event `xml:"event"`
/// Response for update events.
UpdateCheck UpdateCheck `xml:"updatecheck,omitempty"`
/// Reason for failure if status is not Ok
Reason string `xml:"reason"`
}
App defines the applicaiton information in the request
type Event ¶
type Event struct {
XMLName xml.Name `xml:"event"`
// Type of event
Type string `xml:"eventtype,attr"`
// Result of event
Result string `xml:"eventresult,attr"`
}
Event is the event being sent to the server
type Manifest ¶
type Manifest struct {
XMLName xml.Name `xml:"manifest"`
// Version of the update
Version string `xml:"version,attr,omitempty"`
// TraceID for the identification of this update
TraceID string `xml:"trace,attr,omitempty"`
// DownloadURL is the location of the downloadable package
DownloadURL URL `xml:"url"`
// Package contains the validation information for the package
// to be retrieved from DownloadUrl
Package Package `xml:"package"`
}
Manifest of the update package
type Package ¶
type Package struct {
XMLName xml.Name `xml:"package"`
// SHA256Hash of the download package
SHA256Hash string `xml:"hash,attr,omitempty"`
// Name of the download package
Name string `xml:"name,attr,omitempty"`
// SizeInBytes of the download package
SizeInBytes uint64 `xml:"size,attr,omitempty"`
}
Package contains the validation information about an update
type Request ¶
type Request struct {
XMLName xml.Name `xml:"request"`
// Protocol version of the request
Protocol float32 `xml:"protocol,attr"`
// Application information for the request
Application App `xml:"app"`
}
Request contains a subset of the Omaha update request protocol
type Response ¶
type Response struct {
XMLName xml.Name `xml:"response"`
// Protocol version fo the response
Protocol float32 `xml:"protocol,attr"`
// Application being responded on
Application App `xml:"app"`
}
Response contains a subset of the Omaha request protocol
Click to show internal directories.
Click to hide internal directories.