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:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user