client

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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.

func (*APIError) Error

func (e *APIError) Error() string

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"`
}

AddProviderRequest registers a vendor credential. The token is not part of this request: the CLI writes it into the burrow-credentials Secret with the developer's kubeconfig, and only the registry entry — naming the Secret key — flows through the control plane.

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

func NewClient(baseURL, token string) *Client

NewClient returns a control-plane API client for baseURL authenticating with token, using a default HTTP client.

func NewClientWithHTTP

func NewClientWithHTTP(baseURL, token string, hc *http.Client) *Client

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

func (c *Client) AddProvider(ctx context.Context, req AddProviderRequest) (Provider, error)

AddProvider registers a vendor credential in the control-plane registry and returns the recorded provider (ADR-0023).

func (*Client) Deploy

func (c *Client) Deploy(ctx context.Context, app string, req DeployRequest) (DeployResult, error)

func (*Client) Expose added in v0.2.0

func (c *Client) Expose(ctx context.Context, app, host string, port int32, tls bool, issuer string, confirm bool) (ExposeResult, error)

func (*Client) Guardrails added in v0.2.0

func (c *Client) Guardrails(ctx context.Context) ([]Guardrail, error)

Guardrails lists the control-plane guardrails and their current dispositions.

func (*Client) Logs

func (c *Client) Logs(ctx context.Context, app string, tail int) ([]LogLine, error)

func (*Client) Providers added in v0.2.0

func (c *Client) Providers(ctx context.Context) ([]Provider, error)

Providers lists the configured providers, name order.

func (*Client) Reachability added in v0.2.0

func (c *Client) Reachability(ctx context.Context, app string) (ReachabilityResult, error)

Reachability reports whether an app is reachable at its hostname, link by link.

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) Rollback

func (c *Client) Rollback(ctx context.Context, app string) (RollbackResult, error)

func (*Client) Scale

func (c *Client) Scale(ctx context.Context, app string, replicas int32, confirm bool) (ScaleResult, error)

func (*Client) SetGuardrail added in v0.2.0

func (c *Client) SetGuardrail(ctx context.Context, code, disposition string) ([]Guardrail, error)

SetGuardrail sets a guardrail's disposition and returns the updated policy.

func (*Client) Status

func (c *Client) Status(ctx context.Context, app string) (StatusResult, error)

func (*Client) Unexpose added in v0.2.0

func (c *Client) Unexpose(ctx context.Context, app string) error

type DeployRequest

type DeployRequest struct {
	Image    string            `json:"image"`
	Env      map[string]string `json:"env,omitempty"`
	Command  []string          `json:"command,omitempty"`
	Replicas int32             `json:"replicas"`
	Confirm  bool              `json:"confirm,omitempty"`
}

type DeployResult

type DeployResult struct {
	Release             Release `json:"release"`
	SupersededReleaseID string  `json:"superseded_release_id,omitempty"`
}

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 ExposeResult struct {
	App  string `json:"app"`
	Host string `json:"host"`
	Port int32  `json:"port"`
	URL  string `json:"url"`
}

type Guardrail added in v0.2.0

type Guardrail struct {
	Code        string `json:"code"`
	Disposition string `json:"disposition"`
	Description string `json:"description"`
}

type LogLine

type LogLine struct {
	Pod       string    `json:"pod"`
	Timestamp time.Time `json:"timestamp"`
	Message   string    `json:"message"`
}

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 RollbackResult struct {
	Release               Release `json:"release"`
	RolledBackToReleaseID string  `json:"rolled_back_to_release_id"`
	SupersededReleaseID   string  `json:"superseded_release_id"`
}

type ScaleResult

type ScaleResult struct {
	App              string `json:"app"`
	PreviousReplicas int32  `json:"previous_replicas"`
	Replicas         int32  `json:"replicas"`
}

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"`
}

type WorkloadStatus

type WorkloadStatus struct {
	App             string `json:"app"`
	Kind            string `json:"kind"`
	Image           string `json:"image"`
	DesiredReplicas int32  `json:"desired_replicas"`
	ReadyReplicas   int32  `json:"ready_replicas"`
	UpdatedReplicas int32  `json:"updated_replicas"`
	Available       bool   `json:"available"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL