This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
2018-09-21 12:31:52 +02:00
|
|
|
package updater
|
|
|
|
|
2018-09-26 12:05:55 +02:00
|
|
|
import "context"
|
|
|
|
|
2018-09-21 12:31:52 +02:00
|
|
|
const (
|
|
|
|
eventGetReachViewVersion = "get reachview version"
|
|
|
|
eventReachViewVersionResults = "current reachview version"
|
|
|
|
)
|
|
|
|
|
|
|
|
type reachViewVersion struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReachViewVersion returns the ReachRS module ReachView version
|
2018-09-26 12:05:55 +02:00
|
|
|
func (c *Client) ReachViewVersion(ctx context.Context) (string, error) {
|
2018-09-21 12:31:52 +02:00
|
|
|
res := &reachViewVersion{}
|
2018-09-26 12:05:55 +02:00
|
|
|
if err := c.ReqResp(ctx, eventGetReachViewVersion, nil, eventReachViewVersionResults, res); err != nil {
|
2018-09-21 12:31:52 +02:00
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
return res.Version, nil
|
|
|
|
}
|