versions
This commit is contained in:
@@ -58,6 +58,25 @@ func (c *Client) CheckStatus() (bool, error) {
|
||||
return response.Success, nil
|
||||
}
|
||||
|
||||
// GetVersion gets the daemon version
|
||||
func (c *Client) GetVersion() (string, error) {
|
||||
response, err := c.SendCommand("version", map[string]string{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if !response.Success {
|
||||
return "", fmt.Errorf("failed to get version: %s", response.Error)
|
||||
}
|
||||
|
||||
// The version should be in the Data field as a string
|
||||
if version, ok := response.Data.(string); ok {
|
||||
return version, nil
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("unexpected version response format")
|
||||
}
|
||||
|
||||
// TabInfo contains information about a tab
|
||||
type TabInfo struct {
|
||||
ID string `json:"id"`
|
||||
|
Reference in New Issue
Block a user