protocol: sort xml attributes

A cosmetic change, though this will change the order in the XML output.
The spec lists fields alphabetically so this makes comparison easier.
This commit is contained in:
Michael Marineau 2017-05-02 13:07:50 -07:00
parent 8e6feed630
commit 79e582819b
1 changed files with 10 additions and 10 deletions

View File

@ -32,13 +32,13 @@ type Request struct {
OS *OS `xml:"os"` OS *OS `xml:"os"`
Apps []*AppRequest `xml:"app"` Apps []*AppRequest `xml:"app"`
Protocol string `xml:"protocol,attr"` Protocol string `xml:"protocol,attr"`
Version string `xml:"version,attr,omitempty"` InstallSource string `xml:"installsource,attr,omitempty"`
IsMachine string `xml:"ismachine,attr,omitempty"` IsMachine string `xml:"ismachine,attr,omitempty"`
RequestId string `xml:"requestid,attr,omitempty"` RequestId string `xml:"requestid,attr,omitempty"`
SessionId string `xml:"sessionid,attr,omitempty"` SessionId string `xml:"sessionid,attr,omitempty"`
UserId string `xml:"userid,attr,omitempty"`
InstallSource string `xml:"installsource,attr,omitempty"`
TestSource string `xml:"testsource,attr,omitempty"` TestSource string `xml:"testsource,attr,omitempty"`
UserId string `xml:"userid,attr,omitempty"`
Version string `xml:"version,attr,omitempty"`
// update engine extension, duplicates the version attribute. // update engine extension, duplicates the version attribute.
UpdaterVersion string `xml:"updaterversion,attr,omitempty"` UpdaterVersion string `xml:"updaterversion,attr,omitempty"`
@ -67,24 +67,24 @@ type AppRequest struct {
UpdateCheck *UpdateRequest `xml:"updatecheck"` UpdateCheck *UpdateRequest `xml:"updatecheck"`
Events []*EventRequest `xml:"event" json:",omitempty"` Events []*EventRequest `xml:"event" json:",omitempty"`
Id string `xml:"appid,attr,omitempty"` Id string `xml:"appid,attr,omitempty"`
Version string `xml:"version,attr,omitempty"`
NextVersion string `xml:"nextversion,attr,omitempty"`
Lang string `xml:"lang,attr,omitempty"`
Client string `xml:"client,attr,omitempty"` Client string `xml:"client,attr,omitempty"`
InstallAge string `xml:"installage,attr,omitempty"` InstallAge string `xml:"installage,attr,omitempty"`
Lang string `xml:"lang,attr,omitempty"`
NextVersion string `xml:"nextversion,attr,omitempty"`
Version string `xml:"version,attr,omitempty"`
// update engine extensions // update engine extensions
Track string `xml:"track,attr,omitempty"`
FromTrack string `xml:"from_track,attr,omitempty"`
Board string `xml:"board,attr,omitempty"` Board string `xml:"board,attr,omitempty"`
DeltaOK bool `xml:"delta_okay,attr,omitempty"` DeltaOK bool `xml:"delta_okay,attr,omitempty"`
FromTrack string `xml:"from_track,attr,omitempty"`
Track string `xml:"track,attr,omitempty"`
// coreos update engine extensions // coreos update engine extensions
AlephVersion string `xml:"alephversion,attr,omitempty"`
BootId string `xml:"bootid,attr,omitempty"` BootId string `xml:"bootid,attr,omitempty"`
MachineID string `xml:"machineid,attr,omitempty"` MachineID string `xml:"machineid,attr,omitempty"`
OEM string `xml:"oem,attr,omitempty"` OEM string `xml:"oem,attr,omitempty"`
OEMVersion string `xml:"oemversion,attr,omitempty"` OEMVersion string `xml:"oemversion,attr,omitempty"`
AlephVersion string `xml:"alephversion,attr,omitempty"`
} }
func (a *AppRequest) AddUpdateCheck() *UpdateRequest { func (a *AppRequest) AddUpdateCheck() *UpdateRequest {
@ -116,9 +116,9 @@ type PingRequest struct {
type EventRequest struct { type EventRequest struct {
Type EventType `xml:"eventtype,attr"` Type EventType `xml:"eventtype,attr"`
Result EventResult `xml:"eventresult,attr"` Result EventResult `xml:"eventresult,attr"`
ErrorCode string `xml:"errorcode,attr,omitempty"`
NextVersion string `xml:"nextversion,attr,omitempty"` NextVersion string `xml:"nextversion,attr,omitempty"`
PreviousVersion string `xml:"previousversion,attr,omitempty"` PreviousVersion string `xml:"previousversion,attr,omitempty"`
ErrorCode string `xml:"errorcode,attr,omitempty"`
} }
// Response sent by the Omaha server // Response sent by the Omaha server