This commit is contained in:
Josh at WLTechBlog
2025-08-18 13:01:03 -05:00
parent 4ea5615ef8
commit 1216210150
7 changed files with 84 additions and 0 deletions

View File

@@ -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"`