22 lines
733 B
Go
22 lines
733 B
Go
|
package updater
|
||
|
|
||
|
const (
|
||
|
eventIsReceiverUpgradeAvailable = "is receiver upgrade available"
|
||
|
eventReceiverUpgradeAvailable = "receiver upgrade available"
|
||
|
)
|
||
|
|
||
|
type receiverUpgreAvailable struct {
|
||
|
Available bool `json:"available"`
|
||
|
Running bool `json:"running"`
|
||
|
}
|
||
|
|
||
|
// ReceiverUpgradeAvailable checks if an upgrade is avaialable/running for the ReachRS module
|
||
|
func (c *Client) ReceiverUpgradeAvailable() (bool, bool, error) {
|
||
|
res := &receiverUpgreAvailable{}
|
||
|
if err := c.ReqResp(eventIsReceiverUpgradeAvailable, nil, eventReceiverUpgradeAvailable, res); err != nil {
|
||
|
return false, false, err
|
||
|
}
|
||
|
c.Logf("receiver upgrade result: available: %v, running: %v", res.Available, res.Running)
|
||
|
return res.Available, res.Running, nil
|
||
|
}
|