client

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package client is the Go client for the SynCloud API, used by synctl (and published as the Go SDK later, §7.1). It signs requests with an access key, or sends a personal access token as a Bearer credential.

Index

Constants

View Source
const HeaderSessionToken = "X-Syncloud-Session-Token"

HeaderSessionToken carries the session token of temporary credentials.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	ID              string     `json:"id"`
	Description     string     `json:"description"`
	CreatedAt       time.Time  `json:"createdAt"`
	LastUsedAt      *time.Time `json:"lastUsedAt"`
	LastUsedIP      string     `json:"lastUsedIp"`
	SecretAccessKey string     `json:"secretAccessKey,omitempty"`
}

type AddressRecord

type AddressRecord struct {
	IP         string     `json:"ip"`
	OwnerID    string     `json:"ownerId"`
	Owner      string     `json:"owner"`
	AssignedAt time.Time  `json:"assignedAt"`
	ReleasedAt *time.Time `json:"releasedAt"`
}

type AlertChannel

type AlertChannel struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Type    string `json:"type"`
	Summary string `json:"summary"`
}

AlertChannel is a notification channel (secrets are never returned).

type AlertChannelConfig

type AlertChannelConfig struct {
	URL      string   `json:"url,omitempty"`
	BotToken string   `json:"botToken,omitempty"`
	ChatID   string   `json:"chatId,omitempty"`
	SMTPHost string   `json:"smtpHost,omitempty"`
	SMTPPort int      `json:"smtpPort,omitempty"`
	Username string   `json:"username,omitempty"`
	Password string   `json:"password,omitempty"`
	From     string   `json:"from,omitempty"`
	To       []string `json:"to,omitempty"`
}

AlertChannelConfig holds the settings of one channel type.

type AlertEvent

type AlertEvent struct {
	Rule     string    `json:"rule"`
	Severity string    `json:"severity"`
	Kind     string    `json:"kind"`
	Label    string    `json:"label"`
	Message  string    `json:"message"`
	Delivery string    `json:"delivery"`
	At       time.Time `json:"at"`
}

type AlertState

type AlertState struct {
	Rule     string    `json:"rule"`
	Severity string    `json:"severity"`
	Label    string    `json:"label"`
	State    string    `json:"state"`
	Since    time.Time `json:"since"`
	Message  string    `json:"message"`
}

type AutoDeploy added in v0.1.7

type AutoDeploy struct {
	Watchable    bool       `json:"watchable"`
	Reason       string     `json:"reason,omitempty"`
	Git          bool       `json:"git"`
	BuiltIn      bool       `json:"builtIn"`
	AutoDeploy   bool       `json:"autoDeploy"`
	PollSeconds  int        `json:"pollSeconds"`
	Webhook      bool       `json:"webhook"`
	CheckedAt    *time.Time `json:"checkedAt"`
	LastDigest   string     `json:"lastDigest"`
	LastError    string     `json:"lastError"`
	LastDeployAt *time.Time `json:"lastDeployAt"`
}

AutoDeploy is a service's auto-deploy of new pushes of its image.

type Autoscaling

type Autoscaling struct {
	Policy  *ScalingPolicy `json:"policy"`
	Current struct {
		Value       *float64   `json:"value"`
		EvaluatedAt *time.Time `json:"evaluatedAt"`
	} `json:"current"`
	Units map[string]string `json:"units"`
}

type BackupConfig

type BackupConfig struct {
	Endpoint        string `json:"endpoint"`
	Region          string `json:"region"`
	Bucket          string `json:"bucket"`
	Prefix          string `json:"prefix"`
	AccessKeyID     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
	IntervalMinutes int    `json:"intervalMinutes"`
	Retain          int    `json:"retain"`
}

type BackupObject

type BackupObject struct {
	Name      string    `json:"name"`
	Size      int64     `json:"size"`
	CreatedAt time.Time `json:"createdAt"`
}

type BackupSettings

type BackupSettings struct {
	Configured bool          `json:"configured"`
	Config     *BackupConfig `json:"config"`
	Status     struct {
		LastRunAt     *time.Time `json:"lastRunAt"`
		LastSuccessAt *time.Time `json:"lastSuccessAt"`
		LastError     string     `json:"lastError"`
		LastObject    string     `json:"lastObject"`
		LastSize      int64      `json:"lastSize"`
	} `json:"status"`
}

type Branding added in v0.2.0

type Branding struct {
	Name    string `json:"name"`
	Title   string `json:"title"`
	Version string `json:"version"`
}

Branding is the workspace name, title and logo (Phase 21).

type Build

type Build struct {
	ID          string     `json:"id"`
	ServiceID   string     `json:"serviceId"`
	Project     string     `json:"project"`
	Environment string     `json:"environment"`
	Service     string     `json:"service"`
	SHA         string     `json:"sha"`
	Ref         string     `json:"ref"`
	Trigger     string     `json:"trigger"`
	Status      string     `json:"status"`
	Image       string     `json:"image"`
	RunID       string     `json:"runId"`
	Message     string     `json:"message"`
	Deployed    bool       `json:"deployed"`
	BaseSHA     string     `json:"baseSha"`
	CreatedAt   time.Time  `json:"createdAt"`
	StartedAt   *time.Time `json:"startedAt"`
	FinishedAt  *time.Time `json:"finishedAt"`
}

type BuildSettings

type BuildSettings struct {
	InstallCommand string   `json:"installCommand"`
	BuildCommand   string   `json:"buildCommand"`
	StartCommand   string   `json:"startCommand"`
	PostBuild      []string `json:"postBuild"`
	Variables      []string `json:"variables"`
}

BuildSettings are a Git source's command overrides, build variable names and after-build checks.

type BuildSettingsInput

type BuildSettingsInput struct {
	InstallCommand string             `json:"installCommand"`
	BuildCommand   string             `json:"buildCommand"`
	StartCommand   string             `json:"startCommand"`
	PostBuild      []string           `json:"postBuild"`
	Variables      map[string]*string `json:"variables"`
}

BuildSettingsInput changes them; a nil variable keeps its stored value.

type Certificate

type Certificate struct {
	Host          string     `json:"host"`
	Issuer        string     `json:"issuer"`
	Status        string     `json:"status"`
	NotAfter      time.Time  `json:"notAfter"`
	LastError     string     `json:"lastError"`
	Failures      int        `json:"failures"`
	NextAttemptAt *time.Time `json:"nextAttemptAt"`
	UpdatedAt     time.Time  `json:"updatedAt"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(endpoint string, creds Credentials) (*Client, error)

New returns a client for endpoint, e.g. "https://203-0-113-10.sslip.io".

func (*Client) ActiveAlerts

func (c *Client) ActiveAlerts(ctx context.Context) ([]AlertState, error)

func (*Client) AddServiceDomain

func (c *Client) AddServiceDomain(ctx context.Context, project, env, name, host, port string, opts DomainOptions) (DomainCheck, error)

func (*Client) AlertEvents

func (c *Client) AlertEvents(ctx context.Context, limit int) ([]AlertEvent, error)

func (*Client) ApplyJob

func (c *Client) ApplyJob(ctx context.Context, project, env, name string, spec map[string]any) (Job, error)

func (*Client) ApplyService

func (c *Client) ApplyService(ctx context.Context, project, env, name string, spec ServiceSpec) (Service, error)

func (*Client) CancelDeployment

func (c *Client) CancelDeployment(ctx context.Context, project, env, name, id string) (Service, error)

func (*Client) CancelRun

func (c *Client) CancelRun(ctx context.Context, id string) error

func (*Client) CheckDomain

func (c *Client) CheckDomain(ctx context.Context, host string) (DomainCheck, error)

func (*Client) CheckImage added in v0.1.7

func (c *Client) CheckImage(ctx context.Context, project, env, service string) (ImageUpdate, error)

func (*Client) CheckReachability

func (c *Client) CheckReachability(ctx context.Context, from, to, protocol string, port int) (Reachability, error)

func (*Client) CloneEnvironment

func (c *Client) CloneEnvironment(ctx context.Context, project, name, from string, start bool) (services, jobs []string, err error)

CloneEnvironment creates an environment as a copy of another.

func (*Client) CreateAccessKey

func (c *Client) CreateAccessKey(ctx context.Context, description string) (AccessKey, error)

func (*Client) CreateDeployWebhook added in v0.1.7

func (c *Client) CreateDeployWebhook(ctx context.Context, project, env, service string) (string, error)

CreateDeployWebhook returns the new deploy webhook's path (it holds the secret).

func (*Client) CreateEnvironment

func (c *Client) CreateEnvironment(ctx context.Context, project, name string) (Environment, error)

func (*Client) CreateFirewallPolicy

func (c *Client) CreateFirewallPolicy(ctx context.Context, p FirewallPolicy) (FirewallPolicy, error)

func (*Client) CreateGitConnection

func (c *Client) CreateGitConnection(ctx context.Context, kind, name, serverURL, token string) (GitConnection, error)

func (*Client) CreateGitHubAppManifest

func (c *Client) CreateGitHubAppManifest(ctx context.Context, name, org, githubURL string) (GitHubAppManifest, error)

func (*Client) CreateJoinToken

func (c *Client) CreateJoinToken(ctx context.Context, description string, ttlMinutes int, singleUse bool) (JoinToken, error)

func (*Client) CreateMiddleware

func (c *Client) CreateMiddleware(ctx context.Context, project string, m Middleware) (Middleware, error)

func (*Client) CreateProject

func (c *Client) CreateProject(ctx context.Context, name, description, environment string) (Project, error)

func (*Client) CreateRecoveryKey added in v0.2.0

func (c *Client) CreateRecoveryKey(ctx context.Context) (RecoveryKey, error)

CreateRecoveryKey creates and keeps a key on an install whose key was never kept.

func (*Client) CreateSecurityGroup

func (c *Client) CreateSecurityGroup(ctx context.Context, project string, g SecurityGroup) (SecurityGroup, error)

func (*Client) CreateToken

func (c *Client) CreateToken(ctx context.Context, name string, expiresInDays int) (Token, error)

func (*Client) DNSLookup

func (c *Client) DNSLookup(ctx context.Context, name string) (DNSAnswer, error)

func (*Client) DNSRecords

func (c *Client) DNSRecords(ctx context.Context) ([]DNSRecord, error)

func (*Client) DeleteAccessKey

func (c *Client) DeleteAccessKey(ctx context.Context, id string) error

func (*Client) DeleteAlertChannel

func (c *Client) DeleteAlertChannel(ctx context.Context, id string) error

func (*Client) DeleteAlertRule

func (c *Client) DeleteAlertRule(ctx context.Context, id string) error

func (*Client) DeleteAutoscaling

func (c *Client) DeleteAutoscaling(ctx context.Context, project, env, service string) error
func (c *Client) DeleteBrandingLogo(ctx context.Context) (Branding, error)

func (*Client) DeleteDeployWebhook added in v0.1.7

func (c *Client) DeleteDeployWebhook(ctx context.Context, project, env, service string) error

func (*Client) DeleteEnvironment

func (c *Client) DeleteEnvironment(ctx context.Context, project, name string, everything bool) (pending bool, err error)

DeleteEnvironment deletes an environment, with its services when everything is set (pending: it goes after them).

func (*Client) DeleteFirewallPolicy

func (c *Client) DeleteFirewallPolicy(ctx context.Context, id string) error

func (*Client) DeleteGitConnection

func (c *Client) DeleteGitConnection(ctx context.Context, name string) error

func (*Client) DeleteGitSource

func (c *Client) DeleteGitSource(ctx context.Context, project, env, service string) error

func (*Client) DeleteImage

func (c *Client) DeleteImage(ctx context.Context, repo, tag string) error

func (*Client) DeleteJob

func (c *Client) DeleteJob(ctx context.Context, project, env, name string) error

func (*Client) DeleteJoinToken

func (c *Client) DeleteJoinToken(ctx context.Context, id string) error

func (*Client) DeleteLifecyclePolicy

func (c *Client) DeleteLifecyclePolicy(ctx context.Context, repo string) error

func (*Client) DeleteMiddleware

func (c *Client) DeleteMiddleware(ctx context.Context, project, name string) error

func (*Client) DeleteNode

func (c *Client) DeleteNode(ctx context.Context, id string) error

func (*Client) DeleteProject

func (c *Client) DeleteProject(ctx context.Context, name string, everything bool) (pending bool, err error)

DeleteProject deletes a project; with everything its services go first (pending: the project goes after them).

func (*Client) DeleteSMTP added in v0.2.0

func (c *Client) DeleteSMTP(ctx context.Context) error

func (*Client) DeleteSecurityGroup

func (c *Client) DeleteSecurityGroup(ctx context.Context, project, name string) error

func (*Client) DeleteService

func (c *Client) DeleteService(ctx context.Context, project, env, name string) error

func (*Client) DeleteToken

func (c *Client) DeleteToken(ctx context.Context, id string) error

func (*Client) DeleteUpstreamCredential

func (c *Client) DeleteUpstreamCredential(ctx context.Context, id string) error

func (*Client) DeployBuild

func (c *Client) DeployBuild(ctx context.Context, id string) (Build, error)

func (*Client) DisableBackups

func (c *Client) DisableBackups(ctx context.Context) error

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, in, out any) error

Do sends in (if non-nil) as JSON and decodes a successful response into out (if non-nil).

func (*Client) DrainNode

func (c *Client) DrainNode(ctx context.Context, id string) (Node, error)

func (*Client) EffectiveFirewall

func (c *Client) EffectiveFirewall(ctx context.Context, nodeID string) (EffectiveFirewall, error)

func (*Client) Endpoint added in v0.1.7

func (c *Client) Endpoint() string

Endpoint is the controller's address, e.g. "https://203-0-113-10.sslip.io".

func (*Client) ExecDial

func (c *Client) ExecDial(ctx context.Context, taskID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)

ExecDial opens an interactive command in a task (see the execTask operation). The caller owns the connection.

func (*Client) FirewallCounters

func (c *Client) FirewallCounters(ctx context.Context, node string) ([]RuleCounter, error)

func (*Client) FirewallDrops

func (c *Client) FirewallDrops(ctx context.Context, since, node, direction, ip string) ([]FirewallDrop, error)

func (*Client) GetAutoDeploy added in v0.1.7

func (c *Client) GetAutoDeploy(ctx context.Context, project, env, service string) (AutoDeploy, error)

func (*Client) GetAutoscaling

func (c *Client) GetAutoscaling(ctx context.Context, project, env, service string) (Autoscaling, error)

func (*Client) GetBackupConfig

func (c *Client) GetBackupConfig(ctx context.Context) (BackupSettings, error)

func (*Client) GetBranding added in v0.2.0

func (c *Client) GetBranding(ctx context.Context) (Branding, error)

func (*Client) GetBuildSettings

func (c *Client) GetBuildSettings(ctx context.Context, project, env, service string) (BuildSettings, error)

func (*Client) GetDeployment

func (c *Client) GetDeployment(ctx context.Context, project, env, name, id string) (DeploymentDetail, error)

func (*Client) GetDomainSettings

func (c *Client) GetDomainSettings(ctx context.Context) (DomainSettings, error)

func (*Client) GetGitConnection

func (c *Client) GetGitConnection(ctx context.Context, name string) (GitConnection, error)

func (*Client) GetGitServer

func (c *Client) GetGitServer(ctx context.Context) (GitServer, error)

func (*Client) GetGitSource

func (c *Client) GetGitSource(ctx context.Context, project, env, service string) (GitSource, error)

func (*Client) GetIPAM

func (c *Client) GetIPAM(ctx context.Context) (IPAM, error)

func (*Client) GetJob

func (c *Client) GetJob(ctx context.Context, project, env, name string) (Job, error)

func (*Client) GetLifecyclePolicy

func (c *Client) GetLifecyclePolicy(ctx context.Context, repo string) (LifecyclePolicy, error)

func (*Client) GetMesh

func (c *Client) GetMesh(ctx context.Context) (Mesh, error)

func (*Client) GetRecoveryKey added in v0.2.0

func (c *Client) GetRecoveryKey(ctx context.Context) (RecoveryKey, error)

func (*Client) GetRouting

func (c *Client) GetRouting(ctx context.Context, project, env, name string) ([]PortRoute, error)

func (*Client) GetRun

func (c *Client) GetRun(ctx context.Context, id string) (JobRun, error)

func (*Client) GetSMTP added in v0.2.0

func (c *Client) GetSMTP(ctx context.Context) (SMTP, error)

func (*Client) GetSecurityGroup

func (c *Client) GetSecurityGroup(ctx context.Context, project, name string) (SecurityGroup, error)

func (*Client) GetService

func (c *Client) GetService(ctx context.Context, project, env, name string) (Service, error)

func (*Client) GitServerCredentials

func (c *Client) GitServerCredentials(ctx context.Context) (map[string]string, error)

func (*Client) IPHistory

func (c *Client) IPHistory(ctx context.Context, ip string) ([]AddressRecord, error)

func (*Client) Incidents

func (c *Client) Incidents(ctx context.Context, openOnly bool) ([]Incident, error)

func (*Client) JobRuns

func (c *Client) JobRuns(ctx context.Context, project, env, name string) ([]JobRun, error)

func (*Client) JoinNode

func (c *Client) JoinNode(ctx context.Context, req JoinRequest) (JoinResponse, error)

JoinNode needs no credentials: the join token authorizes it.

func (*Client) ListAccessKeys

func (c *Client) ListAccessKeys(ctx context.Context) ([]AccessKey, error)

func (*Client) ListAlertChannels

func (c *Client) ListAlertChannels(ctx context.Context) ([]AlertChannel, error)

func (*Client) ListAlertRules

func (c *Client) ListAlertRules(ctx context.Context) ([]map[string]any, error)

func (*Client) ListAllMiddlewares

func (c *Client) ListAllMiddlewares(ctx context.Context) ([]Middleware, error)

func (*Client) ListAllSecurityGroups

func (c *Client) ListAllSecurityGroups(ctx context.Context) ([]SecurityGroup, map[string]string, error)

func (*Client) ListBackups

func (c *Client) ListBackups(ctx context.Context) ([]BackupObject, error)

func (*Client) ListBuilds

func (c *Client) ListBuilds(ctx context.Context, project, env, service string) ([]Build, error)

ListBuilds lists a service's builds, or recent builds everywhere when service is "".

func (*Client) ListCertificates

func (c *Client) ListCertificates(ctx context.Context) ([]Certificate, error)

func (*Client) ListEnvironments

func (c *Client) ListEnvironments(ctx context.Context, project string) ([]Environment, error)

func (*Client) ListFirewallPolicies

func (c *Client) ListFirewallPolicies(ctx context.Context) ([]FirewallPolicy, error)

func (*Client) ListGitBranches

func (c *Client) ListGitBranches(ctx context.Context, name, repo string) ([]string, error)

func (*Client) ListGitConnections

func (c *Client) ListGitConnections(ctx context.Context) ([]GitConnection, error)

func (*Client) ListGitRepos

func (c *Client) ListGitRepos(ctx context.Context, name, query string) ([]GitRepo, error)

func (*Client) ListGitSources

func (c *Client) ListGitSources(ctx context.Context) ([]GitSourceSummary, error)

func (*Client) ListImages

func (c *Client) ListImages(ctx context.Context, repo string) ([]Image, error)

func (*Client) ListJobs

func (c *Client) ListJobs(ctx context.Context, project, env string) ([]Job, error)

func (*Client) ListJoinTokens

func (c *Client) ListJoinTokens(ctx context.Context) ([]JoinToken, error)

func (*Client) ListMiddlewares

func (c *Client) ListMiddlewares(ctx context.Context, project string) ([]Middleware, error)

func (*Client) ListNodes

func (c *Client) ListNodes(ctx context.Context) ([]Node, error)

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context) ([]Project, error)

func (*Client) ListRegistryEvents

func (c *Client) ListRegistryEvents(ctx context.Context, repo string, limit int) ([]RegistryEvent, error)

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context) ([]Repository, error)

func (*Client) ListSecurityGroups

func (c *Client) ListSecurityGroups(ctx context.Context, project string) ([]SecurityGroup, error)

func (*Client) ListServiceDomains

func (c *Client) ListServiceDomains(ctx context.Context, project, env, name string) ([]ServiceDomain, error)

func (*Client) ListServices

func (c *Client) ListServices(ctx context.Context, project, env string) ([]Service, error)

func (*Client) ListSystemTasks

func (c *Client) ListSystemTasks(ctx context.Context) ([]SystemTask, error)

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context) ([]Task, error)

func (*Client) ListTokens

func (c *Client) ListTokens(ctx context.Context) ([]Token, error)

func (*Client) ListUpstreamCredentials

func (c *Client) ListUpstreamCredentials(ctx context.Context) ([]UpstreamCredential, error)

func (*Client) Metrics

func (c *Client) Metrics(ctx context.Context, project, env, service, rng string) (Metrics, error)

Metrics charts a service (a series per task) or, with service "", a whole environment (a series per service). rng is 15m, 1h, 6h, 24h or 7d.

func (*Client) NetworkThroughput

func (c *Client) NetworkThroughput(ctx context.Context, rng string) (NetworkThroughput, error)

func (*Client) NodeShellDial

func (c *Client) NodeShellDial(ctx context.Context, nodeID string, command []string, tty bool, cols, rows int) (*websocket.Conn, error)

NodeShellDial opens a shell on a node itself (command empty = login shell).

func (*Client) PreviewLifecyclePolicy

func (c *Client) PreviewLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) ([]LifecycleDecision, error)

PreviewLifecyclePolicy is a dry run of rules against a repository.

func (*Client) PreviewSecurityGroup

func (c *Client) PreviewSecurityGroup(ctx context.Context, project, existing string, g SecurityGroup) ([]PreviewChange, error)

PreviewSecurityGroup shows what saving g would change; existing names the group being edited ("" for a new one).

func (*Client) ProjectAddresses

func (c *Client) ProjectAddresses(ctx context.Context, project, env string) ([]ProjectAddress, error)

func (*Client) ProjectDeployments

func (c *Client) ProjectDeployments(ctx context.Context, project, env, service, status string) ([]Deployment, error)

ProjectDeployments lists a project's deployments; env, service and status narrow it when set.

func (*Client) PutAlertChannel

func (c *Client) PutAlertChannel(ctx context.Context, id, name, typ string, cfg AlertChannelConfig) (AlertChannel, error)

PutAlertChannel creates (id "") or replaces a channel.

func (*Client) PutAlertRule

func (c *Client) PutAlertRule(ctx context.Context, id string, rule map[string]any) (map[string]any, error)

PutAlertRule creates (id "") or replaces a rule given as JSON fields.

func (*Client) PutAutoscaling

func (c *Client) PutAutoscaling(ctx context.Context, project, env, service string, p ScalingPolicy) (Autoscaling, error)

func (*Client) PutLifecyclePolicy

func (c *Client) PutLifecyclePolicy(ctx context.Context, repo string, rules []LifecycleRule) (LifecyclePolicy, error)

func (*Client) PutTraefikCustom

func (c *Client) PutTraefikCustom(ctx context.Context, yaml string) error

func (*Client) PutUpstreamCredential

func (c *Client) PutUpstreamCredential(ctx context.Context, host, username, password string) (UpstreamCredential, error)

func (*Client) QueryLogs

func (c *Client) QueryLogs(ctx context.Context, q LogQuery) ([]LogLine, error)

func (*Client) Raw

func (c *Client) Raw(ctx context.Context, method, path string, body []byte) (int, []byte, error)

Raw sends a request with an optional raw JSON body and returns the response status and body. Paths are relative to the endpoint, e.g. "/api/v1/auth/me".

func (*Client) RedeployService

func (c *Client) RedeployService(ctx context.Context, project, env, name string, runHooks bool) (Service, error)

func (*Client) RegistryCleanups

func (c *Client) RegistryCleanups(ctx context.Context) ([]GCRun, bool, error)

func (*Client) RegistryInfo

func (c *Client) RegistryInfo(ctx context.Context) (RegistryInfo, error)

func (*Client) RegistryStorage added in v0.1.9

func (c *Client) RegistryStorage(ctx context.Context) (RegistryStorage, error)

func (*Client) RemoveServiceDomain

func (c *Client) RemoveServiceDomain(ctx context.Context, project, env, name, host string) error

func (*Client) RenewCertificate

func (c *Client) RenewCertificate(ctx context.Context, host string) error

func (*Client) RestartTask

func (c *Client) RestartTask(ctx context.Context, id string) error

func (*Client) RollbackService

func (c *Client) RollbackService(ctx context.Context, project, env, name string, revision int, runHooks bool) (Service, error)

func (*Client) RunBackup

func (c *Client) RunBackup(ctx context.Context) (BackupObject, error)

func (*Client) RunJob

func (c *Client) RunJob(ctx context.Context, project, env, name string, command []string) (JobRun, error)

func (*Client) RunService

func (c *Client) RunService(ctx context.Context, project, env, service string, command []string) (JobRun, error)

func (*Client) ScaleService

func (c *Client) ScaleService(ctx context.Context, project, env, name string, desired int) (Service, error)

func (*Client) ScalingEvents

func (c *Client) ScalingEvents(ctx context.Context, project, env, service string, limit int) ([]ScalingEvent, error)

func (*Client) Send

func (c *Client) Send(ctx context.Context, method, path string, body []byte, contentType string) (*http.Response, error)

Send sends a signed request with a raw body (any content type) and returns the response for the caller to read and close; non-2xx statuses become errors. For uploads and downloads of files.

func (*Client) ServiceDeployments

func (c *Client) ServiceDeployments(ctx context.Context, project, env, name string) ([]Deployment, error)

func (*Client) ServiceHealth

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

func (*Client) ServiceRevisions

func (c *Client) ServiceRevisions(ctx context.Context, project, env, name string) ([]Revision, error)

func (*Client) ServiceSecurity

func (c *Client) ServiceSecurity(ctx context.Context, project, env, service string) (ServiceSecurity, error)

func (*Client) ServiceTasks

func (c *Client) ServiceTasks(ctx context.Context, project, env, name string) ([]Task, error)

func (*Client) SetAutoDeploy added in v0.1.7

func (c *Client) SetAutoDeploy(ctx context.Context, project, env, service string, on bool, pollSeconds int) (AutoDeploy, error)

func (*Client) SetBackupConfig

func (c *Client) SetBackupConfig(ctx context.Context, cfg BackupConfig) (BackupSettings, error)

func (*Client) SetBaseDomain

func (c *Client) SetBaseDomain(ctx context.Context, baseDomain string) (DomainSettings, error)

func (*Client) SetBranding added in v0.2.0

func (c *Client) SetBranding(ctx context.Context, name, title string) (Branding, error)
func (c *Client) SetBrandingLogo(ctx context.Context, image []byte) (Branding, error)

SetBrandingLogo uploads a PNG, JPEG or WebP image.

func (*Client) SetBuildSettings

func (c *Client) SetBuildSettings(ctx context.Context, project, env, service string, in BuildSettingsInput) (BuildSettings, error)

func (*Client) SetEnvironmentPolicy

func (c *Client) SetEnvironmentPolicy(ctx context.Context, project, env string, in EnvironmentPolicy) (Environment, error)

func (*Client) SetGitServer

func (c *Client) SetGitServer(ctx context.Context, enabled bool) (GitServer, error)

func (*Client) SetGitSource

func (c *Client) SetGitSource(ctx context.Context, project, env, service string, src GitSource) (GitSource, error)

func (*Client) SetNodeSchedulable

func (c *Client) SetNodeSchedulable(ctx context.Context, id string, on bool) (Node, error)

func (*Client) SetProjectNodes

func (c *Client) SetProjectNodes(ctx context.Context, project string, nodes []string) (Project, error)

SetProjectNodes limits the nodes a project's workloads run on (empty = any).

func (*Client) SetRegistryStorage added in v0.1.9

func (c *Client) SetRegistryStorage(ctx context.Context, t RegistryStorageTarget) (RegistryStorage, error)

SetRegistryStorage starts switching the registry's storage.

func (*Client) SetRouting

func (c *Client) SetRouting(ctx context.Context, project, env, name string, ports map[string]RoutingInput) ([]PortRoute, error)

func (*Client) SetSMTP added in v0.2.0

func (c *Client) SetSMTP(ctx context.Context, in SMTP) (SMTP, error)

func (*Client) SetSharedVariables

func (c *Client) SetSharedVariables(ctx context.Context, project, env string, vars map[string]string) ([]string, error)

SetSharedVariables replaces them and returns the redeployed services.

func (*Client) SharedVariables

func (c *Client) SharedVariables(ctx context.Context, project, env string) (map[string]string, error)

SharedVariables returns an environment's shared variables.

func (*Client) StartBuild

func (c *Client) StartBuild(ctx context.Context, project, env, service, ref, sha string) (Build, error)

StartBuild builds the branch head, or sha when given. StartBuild builds the head of ref (a branch or tag; "" = the source's branch) or sha.

func (*Client) StartRegistryCleanup

func (c *Client) StartRegistryCleanup(ctx context.Context) (GCRun, error)

func (*Client) Stream

func (c *Client) Stream(ctx context.Context, path string) (io.ReadCloser, error)

Stream sends a signed GET and returns the open response body for streaming endpoints (e.g. Server-Sent Events). The caller closes it.

func (*Client) SystemStatus

func (c *Client) SystemStatus(ctx context.Context) (SystemStatus, error)

func (*Client) TailLogs

func (c *Client) TailLogs(ctx context.Context, q LogQuery, fn func(LogLine)) error

TailLogs calls fn for every new line until ctx ends or the stream breaks.

func (*Client) TestAlertChannel

func (c *Client) TestAlertChannel(ctx context.Context, id string) error

func (*Client) TestSMTP added in v0.2.0

func (c *Client) TestSMTP(ctx context.Context, to string) (sendErr string, err error)

TestSMTP sends a test email; sendErr is the server's answer when it failed.

func (*Client) TraefikConfig

func (c *Client) TraefikConfig(ctx context.Context) (map[string]any, error)

func (*Client) TraefikCustom

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

func (*Client) TraefikSettings

func (c *Client) TraefikSettings(ctx context.Context) (map[string]any, error)

TraefikSettings is GET /traefik/settings, kept loose so the CLI can set any field by name.

func (*Client) Traffic

func (c *Client) Traffic(ctx context.Context, project, env, service, rng string) (Traffic, error)

Traffic returns request charts and per-route numbers of everything (project ""), an environment (service "") or one service.

func (*Client) TrafficMap

func (c *Client) TrafficMap(ctx context.Context) ([]TrafficMapRoute, error)

func (*Client) UpdateFirewallPolicy

func (c *Client) UpdateFirewallPolicy(ctx context.Context, id string, p FirewallPolicy) (FirewallPolicy, error)

func (*Client) UpdateMiddleware

func (c *Client) UpdateMiddleware(ctx context.Context, project, name string, m Middleware) (Middleware, error)

func (*Client) UpdateProject

func (c *Client) UpdateProject(ctx context.Context, project string, description *string, rollbackWindow *int) (Project, error)

UpdateProject changes a project's description and rollback window (nil leaves a field unchanged).

func (*Client) UpdateSecurityGroup

func (c *Client) UpdateSecurityGroup(ctx context.Context, project, name string, g SecurityGroup) (SecurityGroup, error)

func (*Client) UpdateTraefikSettings

func (c *Client) UpdateTraefikSettings(ctx context.Context, settings map[string]any) (map[string]any, error)

func (*Client) ValidateTraefikCustom

func (c *Client) ValidateTraefikCustom(ctx context.Context, yaml string) error

func (*Client) Whoami

func (c *Client) Whoami(ctx context.Context) (User, error)

func (*Client) WithTLS

func (c *Client) WithTLS(cfg *tls.Config) *Client

WithTLS sets the TLS configuration for the controller connection (for example a pinned self-signed certificate while joining).

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	// Token is a personal access token; used only when no access key is set.
	Token string
	// SessionToken accompanies temporary credentials (SYNAS… keys).
	SessionToken string
}

type DNSAnswer

type DNSAnswer struct {
	Name   string   `json:"name"`
	Found  bool     `json:"found"`
	Source string   `json:"source"`
	Kind   string   `json:"kind"`
	IPs    []string `json:"ips"`
	Error  string   `json:"error"`
}

type DNSRecord

type DNSRecord struct {
	Name string   `json:"name"`
	Kind string   `json:"kind"`
	IPs  []string `json:"ips"`
}

type Deployment

type Deployment struct {
	ID           string     `json:"id"`
	Service      string     `json:"service"`
	Environment  string     `json:"environment"`
	FromRevision int        `json:"fromRevision"`
	ToRevision   int        `json:"toRevision"`
	Status       string     `json:"status"`
	FailedTasks  int        `json:"failedTasks"`
	Message      string     `json:"message"`
	StartedAt    time.Time  `json:"startedAt"`
	FinishedAt   *time.Time `json:"finishedAt"`
	Trigger      string     `json:"trigger"`
	Actor        string     `json:"actor"`
	ActorName    string     `json:"actorName"`
	Image        string     `json:"image"`
	Commit       *struct {
		SHA string `json:"sha"`
		Ref string `json:"ref"`
	} `json:"commit"`
	Changes []DeploymentChange `json:"changes"`
	Hooks   []struct {
		RunID   string `json:"runId"`
		Trigger string `json:"trigger"`
		Status  string `json:"status"`
	} `json:"hooks"`
}

type DeploymentChange

type DeploymentChange struct {
	Field string `json:"field"`
	From  string `json:"from"`
	To    string `json:"to"`
}

DeploymentChange is one difference between the two revisions.

type DeploymentDetail

type DeploymentDetail struct {
	Deployment
	Events []struct {
		At      time.Time `json:"at"`
		Kind    string    `json:"kind"`
		Level   string    `json:"level"`
		Node    string    `json:"node"`
		TaskID  string    `json:"taskId"`
		Message string    `json:"message"`
	} `json:"events"`
	Runs []JobRun `json:"runs"`
}

DeploymentDetail is one deployment with its timeline and hook runs.

type DomainCheck

type DomainCheck struct {
	Host      string   `json:"host"`
	Expected  string   `json:"expected"`
	Addresses []string `json:"addresses"`
	Ready     bool     `json:"ready"`
	Record    string   `json:"record"`
}

type DomainOptions

type DomainOptions struct {
	Path        string `json:"path,omitempty"`
	StripPrefix bool   `json:"stripPrefix,omitempty"`
	RedirectTo  string `json:"redirectTo,omitempty"`
}

DomainOptions are a custom domain's path prefix, prefix stripping and redirect (Phase 15c).

type DomainSettings

type DomainSettings struct {
	BaseDomain    string   `json:"baseDomain"`
	DashboardURL  string   `json:"dashboardUrl"`
	RegistryHost  string   `json:"registryHost"`
	PublicIP      string   `json:"publicIp"`
	PublicIPError string   `json:"publicIpError"`
	Suggestions   []string `json:"suggestions"`
	ACME          struct {
		Enabled      bool   `json:"enabled"`
		DirectoryURL string `json:"directoryUrl"`
		Email        string `json:"email"`
	} `json:"acme"`
	Warnings []string `json:"warnings"`
}

type EffectiveFirewall

type EffectiveFirewall struct {
	Enabled        bool           `json:"enabled"`
	Rules          []FirewallRule `json:"rules"`
	ClusterSources []string       `json:"clusterSources"`
	Ruleset        string         `json:"ruleset"`
}

type Environment

type Environment struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	CreatedAt  time.Time `json:"createdAt"`
	AutoDeploy bool      `json:"autoDeploy"`
	Lock       *struct {
		Reason string    `json:"reason"`
		By     string    `json:"by"`
		At     time.Time `json:"at"`
	} `json:"lock"`
	Deleting bool `json:"deleting"`
}

type EnvironmentPolicy

type EnvironmentPolicy struct {
	AutoDeploy *bool   `json:"autoDeploy,omitempty"`
	Locked     *bool   `json:"locked,omitempty"`
	Reason     *string `json:"reason,omitempty"`
}

EnvironmentPolicy changes an environment's auto-deploy switch and deploy lock; nil fields keep their value.

type Error

type Error struct {
	Status  int
	Code    string
	Message string
}

Error is an API error response.

func (*Error) Error

func (e *Error) Error() string

type FirewallDrop

type FirewallDrop struct {
	At        time.Time `json:"at"`
	Node      string    `json:"node"`
	Direction string    `json:"direction"`
	Src       string    `json:"src"`
	SrcName   string    `json:"srcName"`
	Dst       string    `json:"dst"`
	DstName   string    `json:"dstName"`
	Protocol  string    `json:"protocol"`
	Port      int       `json:"port"`
	Packets   uint64    `json:"packets"`
}

type FirewallPolicy

type FirewallPolicy struct {
	ID          string         `json:"id,omitempty"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Targets     []string       `json:"targets"`
	Rules       []FirewallRule `json:"rules"`
	UpdatedAt   time.Time      `json:"updatedAt,omitzero"`
}

type FirewallRule

type FirewallRule struct {
	ID          string   `json:"id,omitempty"`
	Protocol    string   `json:"protocol"`
	Ports       string   `json:"ports"`
	Sources     []string `json:"sources"`
	Description string   `json:"description"`
}

type GCRun

type GCRun struct {
	ID             string     `json:"id"`
	Trigger        string     `json:"trigger"`
	Status         string     `json:"status"`
	Expired        int        `json:"expired"`
	ReclaimedBytes int64      `json:"reclaimedBytes"`
	Message        string     `json:"message"`
	StartedAt      time.Time  `json:"startedAt"`
	FinishedAt     *time.Time `json:"finishedAt"`
	Details        []struct {
		Repository string `json:"repository"`
		Tag        string `json:"tag"`
		Reason     string `json:"reason"`
	} `json:"details"`
}

type GatewayEndpoint added in v0.2.2

type GatewayEndpoint struct {
	Address    string `json:"address"`
	ServerName string `json:"serverName,omitempty"`
}

GatewayEndpoint is one way to reach the agent gateway; with ServerName set it goes through Traefik (agent.<domain>:443).

type GitConnection

type GitConnection struct {
	ID            string    `json:"id"`
	Kind          string    `json:"kind"`
	Name          string    `json:"name"`
	APIURL        string    `json:"apiUrl"`
	WebURL        string    `json:"webUrl"`
	Account       string    `json:"account"`
	AppSlug       string    `json:"appSlug,omitempty"`
	CreatedAt     time.Time `json:"createdAt"`
	InstallURL    string    `json:"installUrl,omitempty"`
	Services      []string  `json:"services"`
	Installations []string  `json:"installations,omitempty"`
	Problem       string    `json:"problem,omitempty"`
}

GitConnection is a connected Git provider (§5.8).

type GitHubAppManifest

type GitHubAppManifest struct {
	PostURL  string `json:"postUrl"`
	Manifest string `json:"manifest"`
	State    string `json:"state"`
}

GitHubAppManifest starts the GitHub App flow (finished in a browser).

type GitRepo

type GitRepo struct {
	FullName      string `json:"fullName"`
	CloneURL      string `json:"cloneUrl"`
	WebURL        string `json:"webUrl"`
	DefaultBranch string `json:"defaultBranch"`
	Private       bool   `json:"private"`
}

type GitServer

type GitServer struct {
	Enabled    bool   `json:"enabled"`
	State      string `json:"state"`
	URL        string `json:"url"`
	Image      string `json:"image"`
	AdminUser  string `json:"adminUser"`
	Connection string `json:"connection"`
	Problem    string `json:"problem,omitempty"`
}

GitServer is the built-in Git server (Forgejo).

type GitSource

type GitSource struct {
	URL           string            `json:"url"`
	Branch        string            `json:"branch"`
	Tags          string            `json:"tags,omitempty"`
	Paths         []string          `json:"paths,omitempty"`
	Builder       string            `json:"builder,omitempty"`
	Dockerfile    string            `json:"dockerfile"`
	Context       string            `json:"context"`
	Token         string            `json:"token,omitempty"`
	HasToken      bool              `json:"hasToken"`
	AutoDeploy    *bool             `json:"autoDeploy,omitempty"`
	PollSeconds   int               `json:"pollSeconds,omitempty"`
	WebhookPath   string            `json:"webhookPath,omitempty"`
	WebhookSecret string            `json:"webhookSecret,omitempty"`
	LastSHA       string            `json:"lastSha,omitempty"`
	LastCheckedAt *time.Time        `json:"lastCheckedAt,omitempty"`
	LastError     string            `json:"lastError,omitempty"`
	Refs          map[string]string `json:"refs,omitempty"`
	Connection    string            `json:"connection,omitempty"`
	Repo          string            `json:"repo,omitempty"`
	Webhook       string            `json:"webhook,omitempty"`
	HookError     string            `json:"hookError,omitempty"`
}

type GitSourceSummary

type GitSourceSummary struct {
	GitSource
	Project     string `json:"project"`
	Environment string `json:"environment"`
	Service     string `json:"service"`
}

GitSourceSummary is a Git source with the service it builds.

type HealthCheck

type HealthCheck struct {
	Type        string   `json:"type"`
	Path        string   `json:"path,omitempty"`
	Port        string   `json:"port,omitempty"`
	Command     []string `json:"command,omitempty"`
	Interval    int      `json:"interval,omitempty"`
	Timeout     int      `json:"timeout,omitempty"`
	Retries     int      `json:"retries,omitempty"`
	StartPeriod int      `json:"startPeriod,omitempty"`
}

type IPAM

type IPAM struct {
	MeshCIDR      string `json:"meshCidr"`
	ContainerCIDR string `json:"containerCidr"`
	ServiceCIDR   string `json:"serviceCidr"`
	Nodes         []struct {
		Node      string        `json:"node"`
		MeshIP    string        `json:"meshIp"`
		Subnet    string        `json:"subnet"`
		Used      int           `json:"used"`
		Capacity  int           `json:"capacity"`
		Addresses []IPAMAddress `json:"addresses"`
	} `json:"nodes"`
	VIPs []struct {
		Service  string `json:"service"`
		VIP      string `json:"vip"`
		DNSName  string `json:"dnsName"`
		Backends int    `json:"backends"`
	} `json:"vips"`
	Released []struct {
		Kind       string    `json:"kind"`
		Address    string    `json:"address"`
		ReusableAt time.Time `json:"reusableAt"`
	} `json:"released"`
}

type IPAMAddress

type IPAMAddress struct {
	IP      string    `json:"ip"`
	Owner   string    `json:"owner"`
	OwnerID string    `json:"ownerId"`
	Kind    string    `json:"kind"`
	Since   time.Time `json:"since"`
}

type Image

type Image struct {
	Tag          string     `json:"tag"`
	Digest       string     `json:"digest"`
	SizeBytes    int64      `json:"sizeBytes"`
	Platforms    []string   `json:"platforms"`
	Created      *time.Time `json:"created"`
	Pulls        int        `json:"pulls"`
	LastPulledAt *time.Time `json:"lastPulledAt"`
	InUseBy      []struct {
		Project     string `json:"project"`
		Environment string `json:"environment"`
		Service     string `json:"service"`
	} `json:"inUseBy"`
}

type ImageUpdate added in v0.1.7

type ImageUpdate struct {
	Deployed bool   `json:"deployed"`
	Digest   string `json:"digest"`
	Revision int    `json:"revision"`
	Message  string `json:"message"`
}

ImageUpdate is the outcome of a check for a newer push of an image.

type Incident

type Incident struct {
	ID          string     `json:"id"`
	ServiceID   string     `json:"serviceId"`
	Project     string     `json:"project"`
	Environment string     `json:"environment"`
	Service     string     `json:"service"`
	State       string     `json:"state"`
	Cause       string     `json:"cause"`
	OpenedAt    time.Time  `json:"openedAt"`
	ClosedAt    *time.Time `json:"closedAt"`
}

type Job

type Job struct {
	ID          string         `json:"id"`
	Project     string         `json:"project"`
	Environment string         `json:"environment"`
	Name        string         `json:"name"`
	Spec        map[string]any `json:"spec"`
	NextRunAt   *time.Time     `json:"nextRunAt"`
	LastRun     *JobRun        `json:"lastRun"`
}

type JobRun

type JobRun struct {
	ID          string     `json:"id"`
	Job         string     `json:"job"`
	Project     string     `json:"project"`
	Environment string     `json:"environment"`
	Service     string     `json:"service"`
	Revision    int        `json:"revision"`
	Trigger     string     `json:"trigger"`
	Attempt     int        `json:"attempt"`
	Status      string     `json:"status"`
	Node        string     `json:"node"`
	ExitCode    *int       `json:"exitCode"`
	Message     string     `json:"message"`
	Command     []string   `json:"command"`
	CreatedAt   time.Time  `json:"createdAt"`
	StartedAt   *time.Time `json:"startedAt"`
	FinishedAt  *time.Time `json:"finishedAt"`
}

type JoinRequest

type JoinRequest struct {
	Token string `json:"token"`
	Name  string `json:"name"`
	CSR   string `json:"csr"`
}

type JoinResponse

type JoinResponse struct {
	NodeID         string `json:"nodeId"`
	Name           string `json:"name"`
	Certificate    string `json:"certificate"`
	CACertificate  string `json:"caCertificate"`
	GatewayAddress string `json:"gatewayAddress"`
	// Gateways lists the addresses to reach the gateway at, in order.
	Gateways []GatewayEndpoint `json:"gateways,omitempty"`
}

type JoinToken

type JoinToken struct {
	ID          string    `json:"id"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
	ExpiresAt   time.Time `json:"expiresAt"`
	SingleUse   bool      `json:"singleUse"`
	Uses        int       `json:"uses"`
	Token       string    `json:"token,omitempty"`
	Command     string    `json:"command,omitempty"`
}

type LifecycleDecision

type LifecycleDecision struct {
	Image
	Expire bool   `json:"expire"`
	InUse  bool   `json:"inUse"`
	Rule   int    `json:"rule"`
	Reason string `json:"reason"`
}

type LifecyclePolicy

type LifecyclePolicy struct {
	Repository string          `json:"repository"`
	Rules      []LifecycleRule `json:"rules"`
	UpdatedAt  time.Time       `json:"updatedAt"`
}

type LifecycleRule

type LifecycleRule struct {
	Priority      int    `json:"priority"`
	Description   string `json:"description,omitempty"`
	TagPrefix     string `json:"tagPrefix"`
	KeepLast      int    `json:"keepLast,omitempty"`
	OlderThanDays int    `json:"olderThanDays,omitempty"`
}

type LogLine

type LogLine struct {
	Time        time.Time `json:"time"`
	Project     string    `json:"project"`
	Environment string    `json:"environment"`
	Service     string    `json:"service"`
	TaskID      string    `json:"taskId"`
	Revision    string    `json:"revision"`
	Node        string    `json:"node"`
	Stream      string    `json:"stream"`
	Level       string    `json:"level"`
	Message     string    `json:"message"`
	// Fields of request lines (stream "access").
	Fields map[string]string `json:"fields,omitempty"`
}

type LogQuery

type LogQuery struct {
	Project, Environment, Service, Task, Node, Text string
	Since                                           string // e.g. "1h"
	Limit                                           int
	// Stream "access" selects request lines, which take Status ("5xx") and Client.
	Stream, Status, Client string
}

LogQuery selects log lines; empty fields match everything.

type Mesh

type Mesh struct {
	MeshCIDR      string     `json:"meshCidr"`
	ContainerCIDR string     `json:"containerCidr"`
	ServiceCIDR   string     `json:"serviceCidr"`
	Items         []MeshNode `json:"items"`
}

type MeshNode

type MeshNode struct {
	NodeID     string     `json:"nodeId"`
	Name       string     `json:"name"`
	Address    string     `json:"address"`
	Subnet     string     `json:"subnet"`
	Endpoint   string     `json:"endpoint"`
	PublicKey  string     `json:"publicKey"`
	Mode       string     `json:"mode"`
	Generation uint64     `json:"generation"`
	AppliedGen uint64     `json:"appliedGeneration"`
	Error      string     `json:"error"`
	Peers      []MeshPeer `json:"peers"`
}

type MeshPeer

type MeshPeer struct {
	NodeID        string     `json:"nodeId"`
	Name          string     `json:"name"`
	Endpoint      string     `json:"endpoint"`
	LastHandshake *time.Time `json:"lastHandshake"`
	RxBytes       uint64     `json:"rxBytes"`
	TxBytes       uint64     `json:"txBytes"`
	RTTMillis     float64    `json:"rttMs"`
}

type MetricSeries

type MetricSeries struct {
	Key    string       `json:"key"`
	Node   string       `json:"node"`
	Points [][2]float64 `json:"points"`
}

type Metrics

type Metrics struct {
	Start  time.Time                 `json:"start"`
	End    time.Time                 `json:"end"`
	Step   int                       `json:"stepSeconds"`
	Charts map[string][]MetricSeries `json:"charts"`
}

type Middleware

type Middleware struct {
	ID       string          `json:"id,omitempty"`
	Project  string          `json:"project,omitempty"`
	Name     string          `json:"name"`
	Type     string          `json:"type"`
	Config   json.RawMessage `json:"config,omitempty"`
	Services []string        `json:"services"`
}

type NetworkThroughput

type NetworkThroughput struct {
	TopServices []Talker `json:"topServices"`
	TopTasks    []Talker `json:"topTasks"`
}

type Node

type Node struct {
	ID         string       `json:"id"`
	Name       string       `json:"name"`
	Status     string       `json:"status"`
	StatusAt   time.Time    `json:"statusAt"`
	Connected  bool         `json:"connected"`
	LastSeenAt *time.Time   `json:"lastSeenAt"`
	CreatedAt  time.Time    `json:"createdAt"`
	Info       NodeInfo     `json:"info"`
	Metrics    *NodeMetrics `json:"metrics"`
	// Schedulable allows new tasks on the node.
	Schedulable bool `json:"schedulable"`
	Draining    bool `json:"draining"`
}

type NodeInfo

type NodeInfo struct {
	Hostname      string `json:"hostname"`
	OS            string `json:"os"`
	Kernel        string `json:"kernel"`
	Arch          string `json:"arch"`
	CPUCores      int    `json:"cpuCores"`
	MemoryBytes   uint64 `json:"memoryBytes"`
	DiskBytes     uint64 `json:"diskBytes"`
	DockerVersion string `json:"dockerVersion"`
	AgentVersion  string `json:"agentVersion"`
}

type NodeMetrics

type NodeMetrics struct {
	CPUPercent       float64 `json:"cpuPercent"`
	MemoryUsedBytes  uint64  `json:"memoryUsedBytes"`
	MemoryTotalBytes uint64  `json:"memoryTotalBytes"`
	DiskUsedBytes    uint64  `json:"diskUsedBytes"`
	DiskTotalBytes   uint64  `json:"diskTotalBytes"`
	Load1            float64 `json:"load1"`
	Load5            float64 `json:"load5"`
	Load15           float64 `json:"load15"`
	NetRxBytes       uint64  `json:"netRxBytes"`
	NetTxBytes       uint64  `json:"netTxBytes"`
	UptimeSeconds    int64   `json:"uptimeSeconds"`
}

type PortRoute

type PortRoute struct {
	Port       string   `json:"port"`
	Container  int      `json:"container"`
	Protocol   string   `json:"protocol"`
	Generated  bool     `json:"generated"`
	Label      string   `json:"label"`
	Host       string   `json:"host"`
	Public     bool     `json:"public"`
	PublicPort int      `json:"publicPort"`
	Address    string   `json:"address"`
	Allow      []string `json:"allow"`
}

PortRoute is how one port of a service is reached.

type PreviewChange

type PreviewChange struct {
	Service string   `json:"service"`
	Lines   []string `json:"lines"`
	Tasks   int      `json:"tasks"`
	Nodes   []string `json:"nodes"`
}

PreviewChange is one service whose effective rules would change.

type Project

type Project struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	Description    string    `json:"description"`
	Nodes          []string  `json:"nodes"` // allowed nodes; empty = any
	Environments   []string  `json:"environments"`
	RollbackWindow int       `json:"rollbackWindow"`
	CreatedAt      time.Time `json:"createdAt"`
}

type ProjectAddress

type ProjectAddress struct {
	Kind        string       `json:"kind"`
	Service     string       `json:"service"`
	Environment string       `json:"environment"`
	Port        string       `json:"port"`
	Protocol    string       `json:"protocol"`
	Address     string       `json:"address"`
	RedirectTo  string       `json:"redirectTo"`
	Allow       []string     `json:"allow"`
	DNS         *DomainCheck `json:"dns"`
	Certificate *struct {
		Issuer string `json:"issuer"`
		Status string `json:"status"`
	} `json:"certificate"`
}

ProjectAddress is one way into a project's service.

type Reachability

type Reachability struct {
	From     string `json:"from"`
	To       string `json:"to"`
	Protocol string `json:"protocol"`
	Port     int    `json:"port"`
	Verdict  struct {
		Allowed bool       `json:"allowed"`
		Reason  string     `json:"reason"`
		Egress  *RuleMatch `json:"egress"`
		Ingress *RuleMatch `json:"ingress"`
	} `json:"verdict"`
}

type RecoveryKey added in v0.2.0

type RecoveryKey struct {
	Stored      bool   `json:"stored"`
	RecoveryKey string `json:"recoveryKey"`
	Rekey       *struct {
		Rekeyed int      `json:"rekeyed"`
		Skipped []string `json:"skipped"`
		Failed  []string `json:"failed"`
	} `json:"rekey"`
	RekeyError  string        `json:"rekeyError"`
	Backup      *BackupObject `json:"backup"`
	BackupError string        `json:"backupError"`
	StoreError  string        `json:"storeError"`
}

RecoveryKey is the recovery key kept on the instance.

type RegistryEvent

type RegistryEvent struct {
	At         time.Time `json:"at"`
	Action     string    `json:"action"`
	Repository string    `json:"repository"`
	Tag        string    `json:"tag"`
	Digest     string    `json:"digest"`
	Actor      string    `json:"actor"`
	Addr       string    `json:"addr"`
}

type RegistryInfo

type RegistryInfo struct {
	Host        string `json:"host"`
	Alias       string `json:"alias"`
	Login       string `json:"login"`
	SelfSigned  bool   `json:"selfSigned,omitempty"`
	Certificate string `json:"certificate,omitempty"`
	Trust       string `json:"trust,omitempty"`
}

RegistryInfo is the registry's address and how to push to it.

type RegistryStorage added in v0.1.9

type RegistryStorage struct {
	RegistryStorageTarget
	EndpointName string                 `json:"endpointName"`
	EndpointURL  string                 `json:"endpointUrl"`
	Switch       *RegistryStorageSwitch `json:"switch"`
}

type RegistryStorageSwitch added in v0.1.9

type RegistryStorageSwitch struct {
	From     RegistryStorageTarget `json:"from"`
	To       RegistryStorageTarget `json:"to"`
	State    string                `json:"state"`
	Step     string                `json:"step"`
	Progress struct {
		Repositories     int    `json:"repositories"`
		RepositoriesDone int    `json:"repositoriesDone"`
		Images           int    `json:"images"`
		ImagesDone       int    `json:"imagesDone"`
		Blobs            int    `json:"blobs"`
		Skipped          int    `json:"skipped"`
		Bytes            int64  `json:"bytes"`
		Current          string `json:"current"`
	} `json:"progress"`
	Message   string     `json:"message"`
	Kept      string     `json:"kept"`
	Freed     int64      `json:"freedBytes"`
	StartedAt time.Time  `json:"startedAt"`
	EndedAt   *time.Time `json:"endedAt"`
}

type RegistryStorageTarget added in v0.1.9

type RegistryStorageTarget struct {
	Driver   string `json:"driver"` // disk | s3
	Endpoint string `json:"endpoint,omitempty"`
	Bucket   string `json:"bucket,omitempty"`
	Prefix   string `json:"prefix,omitempty"`
}

RegistryStorageTarget is where the registry keeps images (Phase 19).

type Repository

type Repository struct {
	Name         string     `json:"name"`
	Tags         int        `json:"tags"`
	Lifecycle    bool       `json:"lifecycle"`
	Pulls        int        `json:"pulls"`
	LastPushedAt *time.Time `json:"lastPushedAt"`
	LastPulledAt *time.Time `json:"lastPulledAt"`
}

type Revision

type Revision struct {
	Revision  int         `json:"revision"`
	Current   bool        `json:"current"`
	Spec      ServiceSpec `json:"spec"`
	CreatedAt time.Time   `json:"createdAt"`
	CreatedBy string      `json:"createdBy"`
}

type RouteTraffic

type RouteTraffic struct {
	ServiceID   string  `json:"serviceId"`
	Project     string  `json:"project"`
	Environment string  `json:"environment"`
	Service     string  `json:"service"`
	RPS         float64 `json:"rps"`
	Errors4xx   float64 `json:"errors4xx"`
	Errors5xx   float64 `json:"errors5xx"`
	P50Ms       float64 `json:"p50Ms"`
	P95Ms       float64 `json:"p95Ms"`
	BytesIn     float64 `json:"bytesIn"`
	BytesOut    float64 `json:"bytesOut"`
}

RouteTraffic is one routed service's traffic over the last minutes.

type RoutingInput

type RoutingInput struct {
	Generated *bool    `json:"generated,omitempty"`
	Label     *string  `json:"label,omitempty"`
	Public    *bool    `json:"public,omitempty"`
	Allow     []string `json:"allow,omitempty"`
}

RoutingInput changes one port's routing; nil fields keep their value.

type RuleCounter

type RuleCounter struct {
	ID      string `json:"id"`
	Packets uint64 `json:"packets"`
	Bytes   uint64 `json:"bytes"`
}

type RuleMatch

type RuleMatch struct {
	GroupID   string       `json:"groupId"`
	Group     string       `json:"group"`
	Direction string       `json:"direction"`
	Index     int          `json:"index"`
	Rule      SecurityRule `json:"rule"`
}

type SMTP added in v0.2.0

type SMTP struct {
	Configured  bool   `json:"configured,omitempty"`
	Host        string `json:"host"`
	Port        int    `json:"port,omitempty"`
	Security    string `json:"security,omitempty"`
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	HasPassword bool   `json:"hasPassword,omitempty"`
	From        string `json:"from"`
	FromName    string `json:"fromName,omitempty"`
}

SMTP is the platform mail server (Phase 20a).

type ScalingEvent

type ScalingEvent struct {
	At     time.Time `json:"at"`
	From   int       `json:"from"`
	To     int       `json:"to"`
	Metric string    `json:"metric"`
	Value  *float64  `json:"value"`
	Target float64   `json:"target"`
	Reason string    `json:"reason"`
}

type ScalingPolicy

type ScalingPolicy struct {
	Enabled          bool      `json:"enabled"`
	Min              int       `json:"min"`
	Max              int       `json:"max"`
	Metric           string    `json:"metric"`
	Target           float64   `json:"target"`
	ScaleOutCooldown int       `json:"scaleOutCooldown,omitempty"`
	ScaleInCooldown  int       `json:"scaleInCooldown,omitempty"`
	ScaleInChecks    int       `json:"scaleInChecks,omitempty"`
	UpdatedAt        time.Time `json:"updatedAt,omitempty"`
	UpdatedBy        string    `json:"updatedBy,omitempty"`
}

ScalingPolicy is a target tracking policy (§5.5).

type SecurityGroup

type SecurityGroup struct {
	ID          string         `json:"id,omitempty"`
	Project     string         `json:"project,omitempty"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Default     bool           `json:"default,omitempty"`
	Inbound     []SecurityRule `json:"inbound"`
	Outbound    []SecurityRule `json:"outbound"`
	Services    []string       `json:"services"`
	Members     []string       `json:"members,omitempty"`
	CreatedAt   *time.Time     `json:"createdAt,omitempty"`
	UpdatedAt   *time.Time     `json:"updatedAt,omitempty"`
}

type SecurityRule

type SecurityRule struct {
	Protocol    string   `json:"protocol"`
	Ports       string   `json:"ports"`
	Peers       []string `json:"peers"`
	Description string   `json:"description"`
	Packets     uint64   `json:"packets,omitempty"`
	Bytes       uint64   `json:"bytes,omitempty"`
}

SecurityRule allows traffic to (inbound) or from (outbound) a group's members (§8.3).

type Service

type Service struct {
	ID           string      `json:"id"`
	Project      string      `json:"project"`
	Environment  string      `json:"environment"`
	Name         string      `json:"name"`
	Revision     int         `json:"revision"`
	DesiredCount int         `json:"desiredCount"`
	Running      int         `json:"running"`
	Pending      int         `json:"pending"`
	Status       string      `json:"status"`
	Deleting     bool        `json:"deleting"`
	Spec         ServiceSpec `json:"spec"`
	Endpoints    []string    `json:"endpoints"`
	VIP          string      `json:"vip"`
	DNSName      string      `json:"dnsName"`
	Deployment   *Deployment `json:"deployment"`
	CreatedAt    time.Time   `json:"createdAt"`
	UpdatedAt    time.Time   `json:"updatedAt"`
}

type ServiceDomain

type ServiceDomain struct {
	ID          string      `json:"id"`
	Host        string      `json:"host"`
	Path        string      `json:"path"`
	Port        string      `json:"port"`
	StripPrefix bool        `json:"stripPrefix"`
	RedirectTo  string      `json:"redirectTo"`
	CreatedAt   time.Time   `json:"createdAt"`
	DNS         DomainCheck `json:"dns"`
}

type ServiceHealth

type ServiceHealth struct {
	ServiceID   string   `json:"serviceId"`
	Project     string   `json:"project"`
	Environment string   `json:"environment"`
	Service     string   `json:"service"`
	State       string   `json:"state"`
	Reason      string   `json:"reason"`
	Serving     int      `json:"serving"`
	Desired     int      `json:"desired"`
	Uptime24h   *float64 `json:"uptime24h"`
	Uptime7d    *float64 `json:"uptime7d"`
	LastCheck   *struct {
		OK        bool    `json:"ok"`
		Status    int     `json:"status"`
		LatencyMs float64 `json:"latencyMs"`
		Error     string  `json:"error"`
	} `json:"lastCheck"`
	Incident *Incident `json:"incident"`
}

type ServicePort

type ServicePort struct {
	Name      string `json:"name,omitempty"`
	Container int    `json:"container"`
	Protocol  string `json:"protocol,omitempty"`
}

type ServiceSecurity

type ServiceSecurity struct {
	Groups []SecurityGroup `json:"groups"`
	Lines  []string        `json:"lines"`
}

type ServiceSpec

type ServiceSpec struct {
	Image     string            `json:"image"`
	Command   []string          `json:"command,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
	Ports     []ServicePort     `json:"ports,omitempty"`
	Resources struct {
		CPU         float64 `json:"cpu,omitempty"`
		Memory      int     `json:"memory,omitempty"`
		CPUMode     string  `json:"cpuMode,omitempty"`    // "" (shared) | "reserved"
		MemoryMode  string  `json:"memoryMode,omitempty"` // "" (shared) | "reserved"
		CPULimit    float64 `json:"cpuLimit,omitempty"`
		MemoryLimit int     `json:"memoryLimit,omitempty"`
	} `json:"resources"`
	Placement struct {
		Strategy string `json:"strategy,omitempty"`
	} `json:"placement"`
	Health       *HealthCheck   `json:"health,omitempty"`
	Deployment   map[string]any `json:"deployment,omitempty"`
	DesiredCount *int           `json:"desiredCount,omitempty"`
}

type SystemStatus

type SystemStatus struct {
	Version       string `json:"version"`
	SetupRequired bool   `json:"setupRequired"`
	BaseDomain    string `json:"baseDomain"`
}

type SystemTask

type SystemTask struct {
	TaskID      string     `json:"taskId"`
	Name        string     `json:"name"`
	Description string     `json:"description"`
	Image       string     `json:"image"`
	Node        string     `json:"node"`
	State       string     `json:"state"`
	Health      string     `json:"health"`
	Error       string     `json:"error"`
	ContainerID string     `json:"containerId"`
	StartedAt   *time.Time `json:"startedAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
}

type Talker

type Talker struct {
	Key   string  `json:"key"`
	Node  string  `json:"node"`
	Owner string  `json:"owner"`
	RxBps float64 `json:"rxBps"`
	TxBps float64 `json:"txBps"`
}

type Task

type Task struct {
	ID          string     `json:"id"`
	ServiceID   string     `json:"serviceId"`
	Project     string     `json:"project"`
	Environment string     `json:"environment"`
	Service     string     `json:"service"`
	Revision    int        `json:"revision"`
	NodeID      string     `json:"nodeId"`
	Node        string     `json:"node"`
	Desired     string     `json:"desired"`
	State       string     `json:"state"`
	IP          string     `json:"ip"`
	ContainerID string     `json:"containerId"`
	Health      string     `json:"health"`
	ExitCode    int        `json:"exitCode"`
	Error       string     `json:"error"`
	CreatedAt   time.Time  `json:"createdAt"`
	StartedAt   *time.Time `json:"startedAt"`
	FinishedAt  *time.Time `json:"finishedAt"`
}

type Token

type Token struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	CreatedAt  time.Time  `json:"createdAt"`
	ExpiresAt  *time.Time `json:"expiresAt"`
	LastUsedAt *time.Time `json:"lastUsedAt"`
	LastUsedIP string     `json:"lastUsedIp"`
	Token      string     `json:"token,omitempty"`
}

type Traffic

type Traffic struct {
	Metrics
	Routes        []RouteTraffic `json:"routes"`
	WindowSeconds int            `json:"windowSeconds"`
}

type TrafficMapRoute

type TrafficMapRoute struct {
	RouteTraffic
	Hosts []string         `json:"hosts"`
	Tasks []TrafficMapTask `json:"tasks"`
}

type TrafficMapTask

type TrafficMapTask struct {
	ID       string  `json:"id"`
	Node     string  `json:"node"`
	IP       string  `json:"ip"`
	State    string  `json:"state"`
	Health   string  `json:"health"`
	Revision int     `json:"revision"`
	RPS      float64 `json:"rps"`
}

type UpstreamCredential

type UpstreamCredential struct {
	ID        string    `json:"id"`
	Host      string    `json:"host"`
	Username  string    `json:"username"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type User

type User struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Name      string    `json:"name"`
	IsRoot    bool      `json:"isRoot"`
	CreatedAt time.Time `json:"createdAt"`
}

Jump to

Keyboard shortcuts

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