feat: add remote NodeService client backed by the HTTP API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-01 13:18:31 +02:00
parent 3dfc46c3ff
commit 7292751ef7
4 changed files with 141 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ type fileConfig struct {
User string `json:"user"`
UserAliases []*Alias `json:"aliases"`
Serve ServerConfig `json:"serve"`
Remote ServerConfig `json:"remote"`
}
var defaultAliases = []*Alias{
@@ -141,6 +142,17 @@ func (c *fileConfig) ListAliases() ([]*Alias, error) {
return result, nil
}
func (c *fileConfig) GetRemoteConfig() (ServerConfig, bool) {
if c.Remote.Host == "" {
return ServerConfig{}, false
}
port := c.Remote.Port
if port == 0 {
port = 7000
}
return ServerConfig{Host: c.Remote.Host, Port: port}, true
}
func (c *fileConfig) GetServerConfig() ServerConfig {
host := c.Serve.Host
if host == "" {