Cleanup, signing and update of internals.

This commit is contained in:
2025-12-15 00:32:53 +00:00
parent 2d9c28657b
commit 100251b896
19 changed files with 439 additions and 313 deletions
-19
View File
@@ -29,14 +29,6 @@ func New(socketPath string) *Client {
}
}
// NewWithTimeout creates a new client with a custom timeout.
func NewWithTimeout(socketPath string, timeout time.Duration) *Client {
return &Client{
socketPath: socketPath,
timeout: timeout,
}
}
// Connect establishes a connection to the daemon.
func (c *Client) Connect() error {
c.mu.Lock()
@@ -435,14 +427,3 @@ func (c *Client) ListPresets() ([]protocol.PresetInfo, error) {
}
return data.Presets, nil
}
// IsConnected checks if the daemon is reachable.
func IsConnected(socketPath string) bool {
client := New(socketPath)
if err := client.Connect(); err != nil {
return false
}
defer client.Close()
return client.Ping() == nil
}