versions
This commit is contained in:
1 parent
4ea5615ef8
commit
1216210150
7 files changed
+84
No files matched your search
@@ -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