diff --git a/omaha/protocol.go b/omaha/protocol.go index 98cce51..0cc4aa5 100644 --- a/omaha/protocol.go +++ b/omaha/protocol.go @@ -79,6 +79,15 @@ func (r *Request) AddApp(id, version string) *AppRequest { return a } +func (r *Request) GetApp(id string) *AppRequest { + for _, app := range r.Apps { + if app.ID == id { + return app + } + } + return nil +} + type AppRequest struct { Ping *PingRequest `xml:"ping"` UpdateCheck *UpdateRequest `xml:"updatecheck"` @@ -181,6 +190,15 @@ func (r *Response) AddApp(id string, status AppStatus) *AppResponse { return a } +func (r *Response) GetApp(id string) *AppResponse { + for _, app := range r.Apps { + if app.ID == id { + return app + } + } + return nil +} + type AppResponse struct { Ping *PingResponse `xml:"ping"` UpdateCheck *UpdateResponse `xml:"updatecheck"`