omaha: split request and response structures
Despite having common names between the request and response XML structures the actual values which may appear in them are completely disjoint. Splitting the types up makes the protocol easier to understand when reading the code. When applicable, required fields like status are passed to Add* methods.
This commit is contained in:
parent
ec70842bdd
commit
75a1125f53
2 changed files with 101 additions and 61 deletions
|
@ -83,10 +83,8 @@ func TestOmahaRequestUpdateCheck(t *testing.T) {
|
|||
func ExampleNewResponse() {
|
||||
response := NewResponse()
|
||||
app := response.AddApp("{52F1B9BC-D31A-4D86-9276-CBC256AADF9A}", "ok")
|
||||
p := app.AddPing()
|
||||
p.Status = "ok"
|
||||
u := app.AddUpdateCheck()
|
||||
u.Status = "ok"
|
||||
app.AddPing()
|
||||
u := app.AddUpdateCheck(UpdateOK)
|
||||
u.AddURL("http://localhost/updates")
|
||||
m := u.AddManifest("9999.0.0")
|
||||
k := m.AddPackage()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue