24 lines
775 B
Go
24 lines
775 B
Go
package updater
|
|
|
|
import "context"
|
|
|
|
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(ctx context.Context) (bool, bool, error) {
|
|
res := &receiverUpgreAvailable{}
|
|
if err := c.ReqResp(ctx, 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
|
|
}
|