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:
@@ -4,6 +4,7 @@ import (
|
||||
"axolotl/models"
|
||||
"axolotl/store"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// NodeService is the single entry point for all node operations.
|
||||
@@ -76,6 +77,10 @@ func GetNodeService(cfg Config) (NodeService, error) {
|
||||
if user == "" {
|
||||
return nil, fmt.Errorf("no user configured: run 'ax user set <username>' first")
|
||||
}
|
||||
if rc, ok := cfg.GetRemoteConfig(); ok {
|
||||
base := fmt.Sprintf("http://%s:%d", rc.Host, rc.Port)
|
||||
return &apiClient{base: base, user: user, http: &http.Client{}}, nil
|
||||
}
|
||||
st, err := store.FindAndOpenSQLiteStore()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user