client: add application oem attribute

This commit is contained in:
Michael Marineau 2017-06-05 14:00:40 -07:00
parent b2ea5e0e78
commit 3b5d143dc5

View file

@ -53,6 +53,7 @@ type AppClient struct {
appID string appID string
track string track string
version string version string
oem string
} }
// New creates an omaha client for updating one or more applications. // New creates an omaha client for updating one or more applications.
@ -178,6 +179,12 @@ func (ac *AppClient) SetTrack(track string) error {
return nil return nil
} }
// SetOEM sets the application OEM name.
// This is a update_engine/Core Update protocol extension.
func (ac *AppClient) SetOEM(oem string) {
ac.oem = oem
}
func (ac *AppClient) UpdateCheck() (*omaha.UpdateResponse, error) { func (ac *AppClient) UpdateCheck() (*omaha.UpdateResponse, error) {
req := ac.newReq() req := ac.newReq()
app := req.Apps[0] app := req.Apps[0]
@ -265,6 +272,7 @@ func (ac *AppClient) newReq() *omaha.Request {
app := req.AddApp(ac.appID, ac.version) app := req.AddApp(ac.appID, ac.version)
app.Track = ac.track app.Track = ac.track
app.OEM = ac.oem
// MachineID and BootID are non-standard fields used by CoreOS' // MachineID and BootID are non-standard fields used by CoreOS'
// update_engine and Core Update. Copy their values from the // update_engine and Core Update. Copy their values from the