Skip to content

Go SDK

The Go client for the Agent-Fabric control-plane API — net/http-based, typed models, generated from the OpenAPI spec so it never drifts from the server. New here? Start with the SDKs overview for the auth model and base URLs.

import agentfabric "github.com/falcons-eyes/agentfabric-go/agentfabric" // then: go mod tidy

NewConfiguration() defaults Servers[0] to https://api.falconoon.com. Pass the bearer token (prod: your Cognito OIDC access token · dev: dev:<workspace>) via the request context. Each resource is a service on the client; calls use a request-builder + Execute().

import (
"context"
"fmt"
agentfabric "github.com/falcons-eyes/agentfabric-go/agentfabric"
)
cfg := agentfabric.NewConfiguration()
client := agentfabric.NewAPIClient(cfg)
ctx := context.WithValue(context.Background(), agentfabric.ContextAccessToken, "dev:acme")
// list your networks
nets, _, err := client.NetworksAPI.GetApiNetworks(ctx).Execute()
if err != nil {
panic(err)
}
for _, nw := range nets {
fmt.Println(nw.GetID(), nw.GetName(), nw.GetCIDR())
}
// create one
nw, _, err := client.NetworksAPI.PostApiNetworks(ctx).
CreateNetworkRequest(agentfabric.CreateNetworkRequest{Name: "prod"}).Execute()
if err != nil {
panic(err)
}
fmt.Println("created", nw.GetID())
  • Typed models with GetX() accessors. Network uses PascalCase wire keys, so it’s nw.GetID(), nw.GetCIDR() — see the casing note in the overview.
  • Execute() returns (value, *http.Response, error); check err and, if you need it, the raw response for the status code.

The full endpoint + model surface is the HTTP API reference. Regenerate from the spec with make sdk-go.