Documentation
¶
Overview ¶
Package ahclient provides a typed HTTP client for the agentic-hosting API. It has no dependencies on internal server packages — types are defined independently.
Index ¶
- Variables
- func DefaultConfigPath() (string, error)
- func ExecRequestTimeout(execSeconds int) time.Duration
- type APIError
- type APIKey
- type ActivityEvent
- type ActivityFilter
- type Build
- type Client
- func (c *Client) CancelBuild(serviceID, buildID string) (*StatusResponse, error)
- func (c *Client) CancelDeployment(serviceID, deploymentID string) (*Deployment, error)
- func (c *Client) CreateDatabase(req CreateDatabaseRequest) (*Database, error)
- func (c *Client) CreateEnvironment(req CreateEnvironmentRequest) (*Environment, error)
- func (c *Client) CreateKey(req CreateKeyRequest) (*CreateKeyResponse, error)
- func (c *Client) CreatePreview(envID string, req CreatePreviewRequest) (*Preview, error)
- func (c *Client) CreateService(req CreateServiceRequest) (*Service, error)
- func (c *Client) CreateSnapshot(serviceID string, req CreateSnapshotRequest) (*Snapshot, error)
- func (c *Client) DeleteDatabase(dbID string) error
- func (c *Client) DeleteEnvironment(envID string) error
- func (c *Client) DeletePreview(envID, previewID string) error
- func (c *Client) DeleteService(serviceID string) error
- func (c *Client) DeleteServiceEnv(serviceID, key string) error
- func (c *Client) DeleteSnapshot(snapshotID string) error
- func (c *Client) DeleteTenant() error
- func (c *Client) EnvironmentExec(envID string, command []string, workDir string, timeoutSeconds int) (*ExecResult, error)
- func (c *Client) ExtendEnvironmentLease(envID string, durationSeconds int) (*Environment, error)
- func (c *Client) GetBuild(serviceID, buildID string) (*Build, error)
- func (c *Client) GetBuildLogs(serviceID, buildID string, follow bool) (io.ReadCloser, error)
- func (c *Client) GetDatabase(dbID string) (*Database, error)
- func (c *Client) GetDatabaseConnectionString(dbID string) (string, error)
- func (c *Client) GetEnvironment(envID string) (*Environment, error)
- func (c *Client) GetEnvironmentTemplate(templateID string) (*EnvironmentTemplate, error)
- func (c *Client) GetService(serviceID string) (*Service, error)
- func (c *Client) GetServiceEnv(serviceID string, reveal bool) (map[string]string, error)
- func (c *Client) GetServiceLogs(serviceID string, follow bool, tail int) (io.ReadCloser, error)
- func (c *Client) GetSnapshot(snapshotID string, reveal bool) (*Snapshot, error)
- func (c *Client) GetTenant() (*Tenant, error)
- func (c *Client) GetTenantUsage() (*TenantUsage, error)
- func (c *Client) Health() (*HealthResponse, error)
- func (c *Client) HealthDetailed(fresh bool) (*DetailedHealthResponse, error)
- func (c *Client) ListActivity(filter ActivityFilter) ([]ActivityEvent, error)
- func (c *Client) ListBuilds() ([]Build, error)
- func (c *Client) ListBuildsForService(serviceID string) ([]Build, error)
- func (c *Client) ListDatabases() ([]Database, error)
- func (c *Client) ListDeployments(serviceID string) ([]Deployment, error)
- func (c *Client) ListEnvironmentTemplates() ([]EnvironmentTemplate, error)
- func (c *Client) ListEnvironments() ([]Environment, error)
- func (c *Client) ListKeys() ([]APIKey, error)
- func (c *Client) ListPreviews(envID string) ([]Preview, error)
- func (c *Client) ListServices() ([]Service, error)
- func (c *Client) ListSnapshots() ([]Snapshot, error)
- func (c *Client) ReactivateTenant(tenantID, bootstrapToken string) (*ReactivateResponse, error)
- func (c *Client) RecoverKey(email, bootstrapToken string) (*KeyRecoverResponse, error)
- func (c *Client) RedeployService(serviceID string) (*Service, error)
- func (c *Client) Register(name, email, bootstrapToken string) (*RegisterResponse, error)
- func (c *Client) ResetService(serviceID string) (*StatusResponse, error)
- func (c *Client) RestartService(serviceID string) (*StatusResponse, error)
- func (c *Client) RevokeKey(keyID string) error
- func (c *Client) SetServiceEnv(serviceID string, vars map[string]string) (*StatusResponse, error)
- func (c *Client) StartBuild(serviceID string, req StartBuildRequest) (*StartBuildResponse, error)
- func (c *Client) StartEnvironment(envID string) (*StatusResponse, error)
- func (c *Client) StartService(serviceID string) (*StatusResponse, error)
- func (c *Client) StopEnvironment(envID string) (*StatusResponse, error)
- func (c *Client) StopService(serviceID string) (*StatusResponse, error)
- func (c *Client) SyncWorkspace(envID string, req SyncRequest) (*StatusResponse, error)
- func (c *Client) UpdateService(serviceID, name string) (*Service, error)
- func (c *Client) UpdateTenant(req UpdateTenantRequest) (*Tenant, error)
- type Config
- type ConnectionStringResponse
- type CreateDatabaseRequest
- type CreateEnvironmentRequest
- type CreateKeyRequest
- type CreateKeyResponse
- type CreatePreviewRequest
- type CreateServiceRequest
- type CreateSnapshotRequest
- type Database
- type Deployment
- type DetailedHealthResponse
- type DiskInfo
- type DockerInfo
- type DockerStorageInfo
- type Environment
- type EnvironmentTemplate
- type ExecResult
- type GVisorInfo
- type HealthResponse
- type KeyRecoverRequest
- type KeyRecoverResponse
- type LoadOptions
- type Preview
- type ReactivateResponse
- type RegisterRequest
- type RegisterResponse
- type Service
- type Snapshot
- type StartBuildRequest
- type StartBuildResponse
- type StatusResponse
- type SyncRequest
- type Tenant
- type TenantUsage
- type UpdateServiceRequest
- type UpdateTenantRequest
- type UsageBucket
Constants ¶
This section is empty.
Variables ¶
var ErrNoConfig = errors.New("no configuration found — run 'ahc configure' or set AH_URL and AH_KEY environment variables")
ErrNoConfig is returned by LoadConfig when neither the environment nor a config file supplies any value.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns the default configuration file path (~/.ah/config.json).
func ExecRequestTimeout ¶
ExecRequestTimeout returns the HTTP timeout for an exec request. The server defaults to 60s and caps at 300s; a 5s response allowance is added.
Types ¶
type APIKey ¶
type APIKey struct {
ID string `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
CreatedAt int64 `json:"created_at"`
LastUsedAt *int64 `json:"last_used_at,omitempty"`
ExpiresAt *int64 `json:"expires_at,omitempty"`
}
APIKey holds API key metadata (no secret value).
type ActivityEvent ¶
type ActivityEvent struct {
ID string `json:"id"`
ResourceType string `json:"resource_type"`
ResourceID string `json:"resource_id"`
ResourceName string `json:"resource_name,omitempty"`
Action string `json:"action"`
Status string `json:"status,omitempty"`
Message string `json:"message"`
CreatedAt int64 `json:"created_at"`
ServiceID string `json:"service_id,omitempty"`
}
ActivityEvent holds a single activity event.
type ActivityFilter ¶
type ActivityFilter struct {
ResourceType string
Action string
ServiceID string
Since int64
Limit int
Offset int
}
ActivityFilter holds optional query parameters for filtering activity events.
type Build ¶
type Build struct {
ID string `json:"id"`
ServiceID string `json:"service_id"`
ServiceName string `json:"service_name,omitempty"`
TenantID string `json:"tenant_id"`
Status string `json:"status"`
SourceType string `json:"source_type"`
SourceURL string `json:"source_url,omitempty"`
SourceRef string `json:"source_ref"`
Image string `json:"image,omitempty"`
NixpacksPlan string `json:"nixpacks_plan,omitempty"`
StartedAt *int64 `json:"started_at,omitempty"`
FinishedAt *int64 `json:"finished_at,omitempty"`
CreatedAt int64 `json:"created_at"`
}
Build represents a build record.
type Client ¶
Client is a typed HTTP client for the agentic-hosting API.
func NewClientNoTimeout ¶
NewClientNoTimeout creates a client without a request timeout. Use this for streaming endpoints (logs, build output).
func (*Client) CancelBuild ¶
func (c *Client) CancelBuild(serviceID, buildID string) (*StatusResponse, error)
CancelBuild cancels a running or queued build.
func (*Client) CancelDeployment ¶
func (c *Client) CancelDeployment(serviceID, deploymentID string) (*Deployment, error)
CancelDeployment cancels a deployment that has not started yet (status pending).
func (*Client) CreateDatabase ¶
func (c *Client) CreateDatabase(req CreateDatabaseRequest) (*Database, error)
CreateDatabase creates a new database.
func (*Client) CreateEnvironment ¶
func (c *Client) CreateEnvironment(req CreateEnvironmentRequest) (*Environment, error)
CreateEnvironment creates a new environment.
func (*Client) CreateKey ¶
func (c *Client) CreateKey(req CreateKeyRequest) (*CreateKeyResponse, error)
CreateKey creates a new API key.
func (*Client) CreatePreview ¶
func (c *Client) CreatePreview(envID string, req CreatePreviewRequest) (*Preview, error)
CreatePreview creates a preview route for an environment port.
func (*Client) CreateService ¶
func (c *Client) CreateService(req CreateServiceRequest) (*Service, error)
CreateService creates a new service.
func (*Client) CreateSnapshot ¶
func (c *Client) CreateSnapshot(serviceID string, req CreateSnapshotRequest) (*Snapshot, error)
CreateSnapshot creates a snapshot of a service.
func (*Client) DeleteDatabase ¶
DeleteDatabase deletes a database.
func (*Client) DeleteEnvironment ¶
DeleteEnvironment deletes an environment.
func (*Client) DeletePreview ¶
DeletePreview deletes a preview route.
func (*Client) DeleteService ¶
DeleteService deletes a service.
func (*Client) DeleteServiceEnv ¶
DeleteServiceEnv deletes an env var from a service.
func (*Client) DeleteSnapshot ¶
DeleteSnapshot deletes a snapshot.
func (*Client) DeleteTenant ¶
DeleteTenant suspends the current tenant account.
func (*Client) EnvironmentExec ¶
func (c *Client) EnvironmentExec(envID string, command []string, workDir string, timeoutSeconds int) (*ExecResult, error)
EnvironmentExec executes a command in an environment.
func (*Client) ExtendEnvironmentLease ¶
func (c *Client) ExtendEnvironmentLease(envID string, durationSeconds int) (*Environment, error)
ExtendEnvironmentLease extends the lease on an environment.
func (*Client) GetBuildLogs ¶
GetBuildLogs returns build logs as a streaming reader. If follow is true, the connection stays open until the build completes.
func (*Client) GetDatabase ¶
GetDatabase returns a database by ID.
func (*Client) GetDatabaseConnectionString ¶
GetDatabaseConnectionString returns the connection string for a database. The access is audit-logged server-side.
func (*Client) GetEnvironment ¶
func (c *Client) GetEnvironment(envID string) (*Environment, error)
GetEnvironment returns an environment by ID.
func (*Client) GetEnvironmentTemplate ¶
func (c *Client) GetEnvironmentTemplate(templateID string) (*EnvironmentTemplate, error)
GetEnvironmentTemplate returns a specific environment template.
func (*Client) GetService ¶
GetService returns a service by ID.
func (*Client) GetServiceEnv ¶
GetServiceEnv returns env vars for a service. Pass reveal=true to return values (audit-logged server-side).
func (*Client) GetServiceLogs ¶
GetServiceLogs returns service logs as a streaming reader. If follow is true, the connection stays open for live tailing.
func (*Client) GetSnapshot ¶
GetSnapshot returns a snapshot by ID. Pass reveal=true to include env var values (audit-logged server-side).
func (*Client) GetTenantUsage ¶
func (c *Client) GetTenantUsage() (*TenantUsage, error)
GetTenantUsage returns resource usage for the current tenant.
func (*Client) Health ¶
func (c *Client) Health() (*HealthResponse, error)
Health checks system health (unauthenticated).
func (*Client) HealthDetailed ¶
func (c *Client) HealthDetailed(fresh bool) (*DetailedHealthResponse, error)
HealthDetailed returns detailed system health (authenticated). Pass fresh=true to bypass the server-side cache.
func (*Client) ListActivity ¶
func (c *Client) ListActivity(filter ActivityFilter) ([]ActivityEvent, error)
ListActivity returns activity events, filtered by the given ActivityFilter.
func (*Client) ListBuilds ¶
ListBuilds returns all builds for the current tenant.
func (*Client) ListBuildsForService ¶
ListBuildsForService returns all builds for a specific service.
func (*Client) ListDatabases ¶
ListDatabases returns all databases for the current tenant.
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(serviceID string) ([]Deployment, error)
ListDeployments returns the deployment history for a service.
func (*Client) ListEnvironmentTemplates ¶
func (c *Client) ListEnvironmentTemplates() ([]EnvironmentTemplate, error)
ListEnvironmentTemplates returns all available environment templates.
func (*Client) ListEnvironments ¶
func (c *Client) ListEnvironments() ([]Environment, error)
ListEnvironments returns all environments for the current tenant.
func (*Client) ListPreviews ¶
ListPreviews returns all preview routes for an environment.
func (*Client) ListServices ¶
ListServices returns all services for the current tenant.
func (*Client) ListSnapshots ¶
ListSnapshots returns all snapshots for the current tenant.
func (*Client) ReactivateTenant ¶
func (c *Client) ReactivateTenant(tenantID, bootstrapToken string) (*ReactivateResponse, error)
ReactivateTenant reactivates a suspended tenant. Requires a bootstrap token.
func (*Client) RecoverKey ¶
func (c *Client) RecoverKey(email, bootstrapToken string) (*KeyRecoverResponse, error)
RecoverKey generates a new API key using the bootstrap token and email.
func (*Client) RedeployService ¶
RedeployService redeploys a service (stops and restarts with current image and env).
func (*Client) Register ¶
func (c *Client) Register(name, email, bootstrapToken string) (*RegisterResponse, error)
Register creates a new tenant. Requires a bootstrap token.
func (*Client) ResetService ¶
func (c *Client) ResetService(serviceID string) (*StatusResponse, error)
ResetService resets the circuit breaker for a service.
func (*Client) RestartService ¶
func (c *Client) RestartService(serviceID string) (*StatusResponse, error)
RestartService restarts a service.
func (*Client) SetServiceEnv ¶
SetServiceEnv sets env vars for a service.
func (*Client) StartBuild ¶
func (c *Client) StartBuild(serviceID string, req StartBuildRequest) (*StartBuildResponse, error)
StartBuild starts a new build for a service.
func (*Client) StartEnvironment ¶
func (c *Client) StartEnvironment(envID string) (*StatusResponse, error)
StartEnvironment starts a stopped environment.
func (*Client) StartService ¶
func (c *Client) StartService(serviceID string) (*StatusResponse, error)
StartService starts a stopped service.
func (*Client) StopEnvironment ¶
func (c *Client) StopEnvironment(envID string) (*StatusResponse, error)
StopEnvironment stops a running environment.
func (*Client) StopService ¶
func (c *Client) StopService(serviceID string) (*StatusResponse, error)
StopService stops a running service.
func (*Client) SyncWorkspace ¶
func (c *Client) SyncWorkspace(envID string, req SyncRequest) (*StatusResponse, error)
SyncWorkspace syncs code from a git URL into an environment.
func (*Client) UpdateService ¶
UpdateService renames a service.
func (*Client) UpdateTenant ¶
func (c *Client) UpdateTenant(req UpdateTenantRequest) (*Tenant, error)
UpdateTenant updates the current tenant.
type Config ¶
Config holds the URL and API key for the agentic-hosting API.
func LoadConfig ¶
func LoadConfig(opts LoadOptions) (*Config, error)
LoadConfig loads configuration, merging per field. For each of URL and Key the priority is:
- Environment variables AH_URL, AH_KEY
- Config file at opts.ConfigPath (or ~/.ah/config.json if empty)
(Flags are applied by callers after loading.) A missing file is not an error; an unreadable or malformed file is. Returns ErrNoConfig if nothing is configured.
type ConnectionStringResponse ¶
type ConnectionStringResponse struct {
ConnectionString string `json:"connection_string"`
}
ConnectionStringResponse holds a database connection string.
type CreateDatabaseRequest ¶
CreateDatabaseRequest holds parameters for creating a database.
type CreateEnvironmentRequest ¶
type CreateEnvironmentRequest struct {
Name string `json:"name"`
TemplateID string `json:"template_id,omitempty"`
LeaseDurationSeconds *int `json:"lease_duration_seconds,omitempty"`
}
CreateEnvironmentRequest holds parameters for creating an environment.
type CreateKeyRequest ¶
type CreateKeyRequest struct {
Name string `json:"name"`
ExpiresIn *int64 `json:"expires_in,omitempty"`
}
CreateKeyRequest holds parameters for creating an API key.
type CreateKeyResponse ¶
type CreateKeyResponse struct {
ID string `json:"id"`
Name string `json:"name"`
APIKey string `json:"api_key"`
Prefix string `json:"prefix"`
Expires *int64 `json:"expires_at,omitempty"`
}
CreateKeyResponse is returned after key creation.
type CreatePreviewRequest ¶
CreatePreviewRequest holds parameters for creating a preview route.
type CreateServiceRequest ¶
type CreateServiceRequest struct {
Name string `json:"name"`
Image string `json:"image"`
Port int `json:"port,omitempty"`
Env map[string]string `json:"env,omitempty"`
}
CreateServiceRequest holds parameters for creating a service.
type CreateSnapshotRequest ¶
type CreateSnapshotRequest struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
CreateSnapshotRequest holds parameters for creating a snapshot.
type Database ¶
type Database struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
Name string `json:"name"`
Type string `json:"type"`
Status string `json:"status"`
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
DBName string `json:"db_name,omitempty"`
Username string `json:"username,omitempty"`
ConnectionString string `json:"connection_string,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
Database represents a provisioned database.
type Deployment ¶
type Deployment struct {
ID string `json:"id"`
ServiceID string `json:"service_id"`
TenantID string `json:"tenant_id"`
BuildID string `json:"build_id,omitempty"`
Image string `json:"image"`
Status string `json:"status"`
Trigger string `json:"trigger"`
ContainerID string `json:"container_id,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
StartedAt int64 `json:"started_at"`
CompletedAt *int64 `json:"completed_at,omitempty"`
CancelledAt *int64 `json:"cancelled_at,omitempty"`
CreatedAt int64 `json:"created_at"`
}
Deployment represents a single deployment event for a service.
type DetailedHealthResponse ¶
type DetailedHealthResponse struct {
Status string `json:"status"`
Docker DockerInfo `json:"docker"`
GVisor GVisorInfo `json:"gvisor"`
Disk DiskInfo `json:"disk"`
DockerDisk DiskInfo `json:"docker_disk"`
DockerStorage *DockerStorageInfo `json:"docker_storage,omitempty"`
TraefikNetworks *int `json:"traefik_networks,omitempty"`
}
DetailedHealthResponse holds full system health info.
type DiskInfo ¶
type DiskInfo struct {
TotalGB float64 `json:"total_gb"`
FreeGB float64 `json:"free_gb"`
UsedPercent float64 `json:"used_percent"`
}
DiskInfo holds disk usage info.
type DockerInfo ¶
type DockerInfo struct {
Available bool `json:"available"`
Version string `json:"version,omitempty"`
}
DockerInfo holds Docker availability info.
type DockerStorageInfo ¶
type DockerStorageInfo struct {
ImagesSizeBytes int64 `json:"images_size_bytes"`
ContainersSizeBytes int64 `json:"containers_size_bytes"`
VolumesSizeBytes int64 `json:"volumes_size_bytes"`
BuildCacheSizeBytes int64 `json:"build_cache_size_bytes"`
TotalSizeGB float64 `json:"total_size_gb"`
}
DockerStorageInfo holds Docker object-level storage sizes.
type Environment ¶
type Environment struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
Name string `json:"name"`
TemplateID string `json:"template_id"`
Status string `json:"status"`
ContainerID string `json:"container_id,omitempty"`
LeaseExpiresAt *int64 `json:"lease_expires_at,omitempty"`
LeaseDurationSeconds int `json:"lease_duration_seconds"`
LastActivityAt *int64 `json:"last_activity_at,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
Environment represents a sandboxed dev environment.
type EnvironmentTemplate ¶
type EnvironmentTemplate struct {
ID string `json:"id"`
Name string `json:"name"`
BaseImage string `json:"base_image"`
Description string `json:"description"`
MemoryMB int `json:"memory_mb"`
CPUMillis int `json:"cpu_millicores"`
DiskMB int `json:"disk_mb"`
EgressPolicy string `json:"egress_policy"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
EnvironmentTemplate describes a pre-configured environment type.
type ExecResult ¶
type ExecResult struct {
ExitCode int `json:"exit_code"`
Stdout string `json:"stdout"`
Stderr string `json:"stderr"`
Truncated bool `json:"truncated"`
TimedOut bool `json:"timed_out"`
DurationMs int64 `json:"duration_ms"`
}
ExecResult holds the result of a command execution in an environment.
type GVisorInfo ¶
type GVisorInfo struct {
Available bool `json:"available"`
Version string `json:"version,omitempty"`
}
GVisorInfo holds gVisor availability info.
type HealthResponse ¶
type HealthResponse struct {
Status string `json:"status"`
}
HealthResponse is the minimal health check response.
type KeyRecoverRequest ¶
type KeyRecoverRequest struct {
Email string `json:"email"`
BootstrapToken string `json:"bootstrap_token"`
}
KeyRecoverRequest holds parameters for recovering an API key.
type KeyRecoverResponse ¶
type KeyRecoverResponse struct {
ID string `json:"id"`
Key string `json:"key"`
Name string `json:"name"`
CreatedAt int64 `json:"created_at"`
Warning string `json:"warning,omitempty"`
RevokedKeyID string `json:"revoked_key_id,omitempty"`
}
KeyRecoverResponse is returned after key recovery.
type LoadOptions ¶
type LoadOptions struct {
// ConfigPath overrides the default config file location.
// Leave empty to use the default: ~/.ah/config.json.
ConfigPath string
}
LoadOptions controls where LoadConfig looks for configuration. ConfigPath, if non-empty, overrides the default ~/.ah/config.json path.
type Preview ¶
type Preview struct {
ID string `json:"id"`
EnvironmentID string `json:"environment_id"`
TenantID string `json:"tenant_id"`
Name string `json:"name"`
Port int `json:"port"`
DNSLabel string `json:"dns_label"`
URL string `json:"url,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
Preview represents a preview route exposing an environment port via Traefik.
type ReactivateResponse ¶
type ReactivateResponse struct {
TenantID string `json:"tenant_id"`
APIKey string `json:"api_key"`
Status string `json:"status"`
}
ReactivateResponse is returned after reactivating a tenant.
type RegisterRequest ¶
RegisterRequest holds parameters for registering a tenant.
type RegisterResponse ¶
RegisterResponse is returned after tenant registration.
type Service ¶
type Service struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
Name string `json:"name"`
DNSLabel string `json:"dns_label,omitempty"`
Status string `json:"status"`
Image string `json:"image"`
ContainerID string `json:"container_id,omitempty"`
Port int `json:"port"`
URL string `json:"url,omitempty"`
LastError string `json:"last_error,omitempty"`
CrashCount int `json:"crash_count"`
CircuitOpen bool `json:"circuit_open"`
LastCrashedAt int64 `json:"last_crashed_at,omitempty"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
Service represents a deployed service.
type Snapshot ¶
type Snapshot struct {
ID string `json:"id"`
TenantID string `json:"tenant_id"`
ServiceID string `json:"service_id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
ImageRef string `json:"image_ref"`
ResourceConfig string `json:"resource_config,omitempty"`
Port int `json:"port"`
EnvVars map[string]string `json:"env_vars,omitempty"`
CreatedAt int64 `json:"created_at"`
}
Snapshot represents a point-in-time capture of a service.
type StartBuildRequest ¶
type StartBuildRequest struct {
SourceType string `json:"source_type"`
SourceURL string `json:"source_url"`
SourceRef string `json:"source_ref,omitempty"`
}
StartBuildRequest holds parameters for starting a build.
type StartBuildResponse ¶
type StartBuildResponse struct {
BuildID string `json:"build_id"`
Status string `json:"status"`
Image string `json:"image"`
}
StartBuildResponse is returned by the start build endpoint.
type StatusResponse ¶
StatusResponse is used for simple status responses.
type SyncRequest ¶
SyncRequest holds parameters for syncing code into an environment.
type Tenant ¶
type Tenant struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Status string `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
Tenant holds tenant information.
type TenantUsage ¶
type TenantUsage struct {
Services UsageBucket `json:"services"`
Databases UsageBucket `json:"databases"`
APIKeys UsageBucket `json:"api_keys"`
MemoryMB int `json:"memory_mb"`
CPUCores float64 `json:"cpu_cores"`
DiskGB int `json:"disk_gb"`
RateLimit int `json:"rate_limit"`
}
TenantUsage holds tenant resource usage.
type UpdateServiceRequest ¶
type UpdateServiceRequest struct {
Name string `json:"name"`
}
UpdateServiceRequest holds parameters for renaming a service.
type UpdateTenantRequest ¶
type UpdateTenantRequest struct {
Name *string `json:"name,omitempty"`
}
UpdateTenantRequest holds parameters for updating a tenant.
type UsageBucket ¶
UsageBucket holds used/max counts for a resource.