package common
import (
"context"
"strings"
)
const (
eventGetReachViewVersion = "get reachview version"
eventReachViewVersionResults = "current reachview version"
type reachViewVersion struct {
Version string `json:"version"`
Stable bool `json:"bool"`
}
// ReachViewVersion returns the ReachRS module ReachView version
func (c *Client) ReachViewVersion(ctx context.Context) (string, bool, error) {
res := &reachViewVersion{}
if err := c.ReqResp(ctx, eventGetReachViewVersion, nil, eventReachViewVersionResults, res); err != nil {
return "", false, err
return strings.TrimSpace(res.Version), res.Stable, nil