Documentation
¶
Index ¶
- type APIError
- type AddProviderRequest
- type Addon
- type AuditEntry
- type AuditFilter
- type Client
- func (c *Client) AddDomain(ctx context.Context, host, provider, address, app string, confirm bool) (DomainResult, error)
- func (c *Client) AddProvider(ctx context.Context, req AddProviderRequest) (Provider, error)
- func (c *Client) Addons(ctx context.Context) ([]Addon, error)
- func (c *Client) Apps(ctx context.Context) ([]WorkloadStatus, error)
- func (c *Client) Audit(ctx context.Context, f AuditFilter) ([]AuditEntry, error)
- func (c *Client) ConnectAddon(ctx context.Context, backend, endpoint, secretKey, token string) (Addon, error)
- func (c *Client) DeleteApp(ctx context.Context, app string, confirm bool) error
- func (c *Client) Deploy(ctx context.Context, app string, req DeployRequest) (DeployResult, error)
- func (c *Client) Env(ctx context.Context, app string) (map[string]string, error)
- func (c *Client) Expose(ctx context.Context, app, host string, port int32, tls bool, issuer string, ...) (ExposeResult, error)
- func (c *Client) Guardrails(ctx context.Context) ([]Guardrail, error)
- func (c *Client) InstallAddon(ctx context.Context, addonType string, confirm bool) (Addon, error)
- func (c *Client) Logs(ctx context.Context, app string, tail int) ([]LogLine, error)
- func (c *Client) Providers(ctx context.Context) ([]Provider, error)
- func (c *Client) QueryLogs(ctx context.Context, query string, limit int, backend string) ([]LogEntry, error)
- func (c *Client) QueryMetrics(ctx context.Context, query string, backend string) ([]MetricSample, error)
- func (c *Client) Reachability(ctx context.Context, app string) (ReachabilityResult, error)
- func (c *Client) RemoveAddon(ctx context.Context, name string, confirm bool) error
- func (c *Client) RemoveDomain(ctx context.Context, host, provider string, confirm bool) (DomainResult, error)
- func (c *Client) Rollback(ctx context.Context, app string, confirm bool) (RollbackResult, error)
- func (c *Client) Scale(ctx context.Context, app string, replicas int32, confirm bool) (ScaleResult, error)
- func (c *Client) Secrets(ctx context.Context, app string) ([]string, error)
- func (c *Client) SetEnv(ctx context.Context, app, key, value string, noRestart bool) error
- func (c *Client) SetGuardrail(ctx context.Context, code, disposition string) ([]Guardrail, error)
- func (c *Client) SetSecret(ctx context.Context, app, key, value string, noRestart bool) error
- func (c *Client) Status(ctx context.Context, app string) (StatusResult, error)
- func (c *Client) Unexpose(ctx context.Context, app string) error
- func (c *Client) UnsetEnv(ctx context.Context, app, key string, noRestart bool) error
- func (c *Client) UnsetSecret(ctx context.Context, app, key string, noRestart bool) error
- type DeployRequest
- type DeployResult
- type DomainResult
- type ExposeResult
- type Guardrail
- type LogEntry
- type LogLine
- type MetricSample
- type Provider
- type ReachabilityResult
- type Release
- type RollbackResult
- type ScaleResult
- type StatusResult
- type WorkloadStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
Code string
Message string
// NeedsConfirmation is true when a guardrail held the operation for confirmation
// rather than refusing it: retrying with confirm set lets it proceed (ADR-0020).
NeedsConfirmation bool
}
APIError is a non-2xx response from the control plane, carrying its structured error (a machine-readable code and a human message) so a tool can surface both.
type AddProviderRequest ¶ added in v0.2.0
type AddProviderRequest struct {
Name string `json:"name,omitempty"`
Type string `json:"type"`
SecretKey string `json:"secret_key,omitempty"`
Token string `json:"token,omitempty"`
}
AddProviderRequest registers a vendor credential. The token VALUE travels in this request over burrowd's authenticated, TLS-protected control-plane API; burrowd validates it and writes it into the burrow-credentials Secret (ADR-0030). The value is never logged, never stored in Postgres, never echoed back, and still never carried over MCP — provider add is a human/CLI operation.
type Addon ¶ added in v0.4.0
type Addon struct {
Name string `json:"name"`
Type string `json:"type"`
Mode string `json:"mode"`
Image string `json:"image,omitempty"`
Endpoint string `json:"endpoint"`
Capabilities []string `json:"capabilities"`
Ready bool `json:"ready"`
}
Addon is one installed (and, later, connected) add-on instance.
type AuditEntry ¶ added in v0.5.0
type AuditEntry struct {
ID int64 `json:"id,omitempty"`
Timestamp time.Time `json:"timestamp"`
Operation string `json:"operation"`
Target string `json:"target,omitempty"`
Args map[string]string `json:"args,omitempty"`
GuardrailCode string `json:"guardrail_code,omitempty"`
Disposition string `json:"disposition,omitempty"`
Outcome string `json:"outcome"`
Result string `json:"result,omitempty"`
Caller string `json:"caller,omitempty"`
}
AuditEntry mirrors a control-plane audit row (ADR-0027): a guarded mutating operation and the guardrail decision and outcome that applied. Args is redacted at the source — it carries only safe metadata (names, image reference, replica count, env/secret key NAMES), never a value.
type AuditFilter ¶ added in v0.5.0
AuditFilter narrows an audit query. A zero value lists the latest rows across all apps.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a thin HTTP client for the control-plane API (ADR-0005). The MCP server holds the API bearer token to authenticate to the control plane, but never any cluster credentials — those live only in the control plane. These DTOs mirror the API's JSON contract; the MCP layer (Apache-2.0) deliberately does not import the control-plane packages (FSL), so it stays a decoupled client across the license boundary (LICENSING.md).
func NewClient ¶
NewClient returns a control-plane API client for baseURL authenticating with token, using a default HTTP client.
func NewClientWithHTTP ¶
NewClientWithHTTP is like NewClient but uses the supplied *http.Client. The connect package uses this to route requests through the Kubernetes API-server proxy with a kubeconfig-authenticated transport (ADR-0014). A nil hc gets a default client.
func (*Client) AddDomain ¶ added in v0.2.0
func (c *Client) AddDomain(ctx context.Context, host, provider, address, app string, confirm bool) (DomainResult, error)
AddDomain points host at an address through the named DNS provider (ADR-0018). Give either an explicit address or the name of an exposed app whose ingress address the control plane reads.
func (*Client) AddProvider ¶ added in v0.2.0
AddProvider registers a vendor credential in the control-plane registry and returns the recorded provider (ADR-0023).
func (*Client) Apps ¶ added in v0.3.0
func (c *Client) Apps(ctx context.Context) ([]WorkloadStatus, error)
Apps lists the workload status of every Burrow-managed app.
func (*Client) Audit ¶ added in v0.5.0
func (c *Client) Audit(ctx context.Context, f AuditFilter) ([]AuditEntry, error)
Audit lists audit rows newest-first, optionally filtered by app, operation, and outcome (ADR-0027). It is read-only — the audit log has no write or delete path through the API.
func (*Client) ConnectAddon ¶ added in v0.4.0
func (c *Client) ConnectAddon(ctx context.Context, backend, endpoint, secretKey, token string) (Addon, error)
ConnectAddon registers an existing backend the user already runs (e.g. an in-cluster Loki) as a queryable add-on, recording its endpoint (ADR-0026). Unlike install it deploys nothing. secretKey, when non-empty, names the key in the burrow-credentials Secret under which the backend's bearer token lives; token is the bearer token VALUE for an authenticated backend, which travels over burrowd's authenticated, TLS-protected API and is written to the Secret (ADR-0030) — never logged, never stored in Postgres, never echoed back, never over MCP. Pass an empty token (and empty secretKey) for an unauthenticated backend.
func (*Client) DeleteApp ¶ added in v0.4.0
DeleteApp removes an app entirely — its workload, routing, and release history. The delete is guarded and held for confirmation by default; pass confirm=true to proceed past the hold.
func (*Client) Deploy ¶
func (c *Client) Deploy(ctx context.Context, app string, req DeployRequest) (DeployResult, error)
func (*Client) Guardrails ¶ added in v0.2.0
Guardrails lists the control-plane guardrails and their current dispositions.
func (*Client) InstallAddon ¶ added in v0.4.0
InstallAddon installs the vetted backing service for an add-on type (e.g. "logs").
func (*Client) QueryLogs ¶ added in v0.4.0
func (c *Client) QueryLogs(ctx context.Context, query string, limit int, backend string) ([]LogEntry, error)
QueryLogs queries the installed logs add-on with a LogsQL query (empty matches everything). A non-empty backend targets a specific logs add-on (by its concrete backend or registry name) when more than one serves the logs capability; empty picks the first.
func (*Client) QueryMetrics ¶ added in v0.4.0
func (c *Client) QueryMetrics(ctx context.Context, query string, backend string) ([]MetricSample, error)
QueryMetrics runs an instant PromQL query against the connected metrics add-on (e.g. Prometheus). A non-empty backend targets a specific metrics add-on (by its concrete backend or registry name) when more than one serves the metrics capability; empty picks the first.
func (*Client) Reachability ¶ added in v0.2.0
Reachability reports whether an app is reachable at its hostname, link by link.
func (*Client) RemoveAddon ¶ added in v0.4.0
RemoveAddon removes the named add-on instance.
func (*Client) RemoveDomain ¶ added in v0.2.0
func (c *Client) RemoveDomain(ctx context.Context, host, provider string, confirm bool) (DomainResult, error)
RemoveDomain removes the DNS record the provider holds for host.
func (*Client) Secrets ¶ added in v0.5.0
Secrets returns the KEYS in an app's per-app Secret, never the values (ADR-0028/0004). Secret values live only in the Kubernetes Secret; a list reads keys only and never returns a value.
func (*Client) SetEnv ¶ added in v0.5.0
SetEnv upserts one non-secret env key for an app (ADR-0028). By default the running workload rolls so the app picks the value up; noRestart only persists, landing the change on the next deploy.
func (*Client) SetGuardrail ¶ added in v0.2.0
SetGuardrail sets a guardrail's disposition and returns the updated policy.
func (*Client) SetSecret ¶ added in v0.5.0
SetSecret upserts one secret key=value for an app (ADR-0029). The value travels over burrowd's authenticated, TLS-protected control-plane API, which writes it to the per-app Kubernetes Secret; it is never logged, never stored in Postgres, and is still never carried over MCP (there is no secret-set MCP tool). By default the running workload rolls so it picks the value up; with noRestart the change only persists and lands on the next deploy.
func (*Client) UnsetEnv ¶ added in v0.5.0
UnsetEnv removes one env key for an app (ADR-0028). By default the running workload rolls; with noRestart the removal only persists and lands on the next deploy.
func (*Client) UnsetSecret ¶ added in v0.5.0
UnsetSecret removes one key from an app's per-app Secret (ADR-0028). Removing a key carries no value, so it is allowed over the API/MCP. By default the running workload rolls so it drops the value; with noRestart the change only persists and lands on the next deploy.
type DeployRequest ¶
type DeployRequest struct {
Image string `json:"image"`
Command []string `json:"command,omitempty"`
MetricsPort int32 `json:"metrics_port,omitempty"`
Replicas int32 `json:"replicas"`
Confirm bool `json:"confirm,omitempty"`
}
DeployRequest carries a deploy's code-free metadata. Env is deliberately absent: an app's non-secret config is an independently-managed store, set with SetEnv and sourced at apply time rather than passed per deploy (ADR-0028).
type DeployResult ¶
type DomainResult ¶ added in v0.2.0
type DomainResult struct {
Host string `json:"host"`
Provider string `json:"provider"`
Type string `json:"type,omitempty"`
Address string `json:"address,omitempty"`
}
DomainResult mirrors the control plane's DNS-record outcome (ADR-0018).
type ExposeResult ¶ added in v0.2.0
type LogEntry ¶ added in v0.4.0
type LogEntry struct {
Time string `json:"time,omitempty"`
Message string `json:"message"`
Pod string `json:"pod,omitempty"`
}
LogEntry is one record from a logs query.
type MetricSample ¶ added in v0.4.0
type MetricSample struct {
Labels map[string]string `json:"labels,omitempty"`
Value string `json:"value"`
Time string `json:"time,omitempty"`
}
MetricSample is one sample from a metrics query. Value is the metric's value as a string so PromQL's exact numeric formatting is preserved.
type Provider ¶ added in v0.2.0
type Provider struct {
Name string `json:"name"`
Type string `json:"type"`
Capabilities []string `json:"capabilities"`
SecretKey string `json:"secret_key"`
CreatedAt time.Time `json:"created_at"`
}
Provider mirrors a control-plane provider registry entry (ADR-0023). It carries no token — only the non-secret registry: the vendor type, the capabilities it serves, and the key under which its token lives in the burrow-credentials Secret.
type ReachabilityResult ¶ added in v0.2.0
type ReachabilityResult struct {
App string `json:"app"`
Deployed bool `json:"deployed"`
Ready bool `json:"ready"`
Exposed bool `json:"exposed"`
Host string `json:"host,omitempty"`
Address string `json:"address,omitempty"`
TLS bool `json:"tls"`
DNSPointsAtCluster bool `json:"dns_points_at_cluster"`
DNSAddresses []string `json:"dns_addresses,omitempty"`
Reachable bool `json:"reachable"`
Summary string `json:"summary"`
}
type Release ¶
type Release struct {
ID string `json:"id"`
App string `json:"app"`
Image string `json:"image"`
Digest string `json:"digest,omitempty"`
Env map[string]string `json:"env,omitempty"`
Command []string `json:"command,omitempty"`
Replicas int32 `json:"replicas"`
Status string `json:"status"`
Supersedes string `json:"supersedes,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type RollbackResult ¶
type ScaleResult ¶
type StatusResult ¶
type StatusResult struct {
App string `json:"app"`
HasRelease bool `json:"has_release"`
Release Release `json:"release,omitempty"`
Running bool `json:"running"`
Workload WorkloadStatus `json:"workload,omitempty"`
}