Documentation
¶
Overview ¶
Package api provides a client for communicating with the control-plane API.
Package api provides a client for communicating with the control-plane API.
Index ¶
- Constants
- type App
- type AuthResponse
- type Build
- type BuildConfig
- type BuildStrategy
- type Client
- func (c *Client) AcceptInvitation(ctx context.Context, token, password string) (*AuthResponse, error)
- func (c *Client) ApplyUpdate(ctx context.Context, version string) error
- func (c *Client) CanRegister(ctx context.Context) (bool, error)
- func (c *Client) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)
- func (c *Client) CheckHealth(ctx context.Context) error
- func (c *Client) CreateApp(ctx context.Context, name, description, iconURL string) (*App, error)
- func (c *Client) CreateDomain(ctx context.Context, appID, service, domain string, isWildcard bool) (*Domain, error)
- func (c *Client) CreateInvitation(ctx context.Context, email, role string) (*Invitation, error)
- func (c *Client) CreateOrg(ctx context.Context, req CreateOrgRequest) (*Organization, error)
- func (c *Client) CreateSecret(ctx context.Context, appID, key, value string) error
- func (c *Client) CreateService(ctx context.Context, appID string, svc CreateServiceRequest) (*Service, error)
- func (c *Client) DeleteApp(ctx context.Context, id string) error
- func (c *Client) DeleteDomain(ctx context.Context, id string) error
- func (c *Client) DeleteOrg(ctx context.Context, orgID string) error
- func (c *Client) DeleteSecret(ctx context.Context, appID, key string) error
- func (c *Client) DeleteService(ctx context.Context, appID, serviceName string) error
- func (c *Client) DeleteUser(ctx context.Context, userID string) error
- func (c *Client) Deploy(ctx context.Context, appID, serviceName string) (*Deployment, error)
- func (c *Client) Get(ctx context.Context, path string, result interface{}) error
- func (c *Client) GetApp(ctx context.Context, id string) (*App, error)
- func (c *Client) GetAppLogs(ctx context.Context, appID string) ([]Log, error)
- func (c *Client) GetBuild(ctx context.Context, id string) (*Build, error)
- func (c *Client) GetBuildByDeployment(ctx context.Context, deploymentID string) (*Build, error)
- func (c *Client) GetConfig(ctx context.Context) (*PlatformConfig, error)
- func (c *Client) GetDashboardData(ctx context.Context) (*DashboardStats, []RecentDeployment, []NodeHealth, error)
- func (c *Client) GetDashboardStats(ctx context.Context) (*DashboardStatsResponse, error)
- func (c *Client) GetDeployment(ctx context.Context, id string) (*Deployment, error)
- func (c *Client) GetGitHubConfig(ctx context.Context) (*GitHubConfigStatus, error)
- func (c *Client) GetGitHubInstallURL(ctx context.Context) (string, error)
- func (c *Client) GetGitHubOAuthURL(ctx context.Context) (string, error)
- func (c *Client) GetGitHubSetupURL(ctx context.Context, org string) (string, error)
- func (c *Client) GetInvitationByToken(ctx context.Context, token string) (*Invitation, error)
- func (c *Client) GetNode(ctx context.Context, id string) (*Node, error)
- func (c *Client) GetOrg(ctx context.Context, orgID string) (*Organization, error)
- func (c *Client) GetOrgBySlug(ctx context.Context, slug string) (*Organization, error)
- func (c *Client) GetRaw(ctx context.Context, path string) ([]byte, string, error)
- func (c *Client) GetServiceLogs(ctx context.Context, appID, serviceName string) ([]Log, error)
- func (c *Client) GetSettings(ctx context.Context) (map[string]string, error)
- func (c *Client) GetUserProfile(ctx context.Context) (*store.User, error)
- func (c *Client) ListAllDomains(ctx context.Context) ([]Domain, error)
- func (c *Client) ListAppDeployments(ctx context.Context, appID string) ([]Deployment, error)
- func (c *Client) ListApps(ctx context.Context) ([]App, error)
- func (c *Client) ListBuilds(ctx context.Context) ([]Build, error)
- func (c *Client) ListDeployments(ctx context.Context) ([]Deployment, error)
- func (c *Client) ListGitHubInstallations(ctx context.Context) ([]GitHubInstallation, error)
- func (c *Client) ListGitHubRepos(ctx context.Context) ([]GitHubRepository, error)
- func (c *Client) ListInvitations(ctx context.Context) ([]Invitation, error)
- func (c *Client) ListNodes(ctx context.Context) ([]Node, error)
- func (c *Client) ListOrgs(ctx context.Context) ([]Organization, error)
- func (c *Client) ListSecrets(ctx context.Context, appID string) ([]Secret, error)
- func (c *Client) ListUsers(ctx context.Context) ([]UserInfo, error)
- func (c *Client) Login(ctx context.Context, email, password string) (*AuthResponse, error)
- func (c *Client) Register(ctx context.Context, email, password string) (*AuthResponse, error)
- func (c *Client) ReloadService(ctx context.Context, appID, serviceName string) error
- func (c *Client) ResetGitHubConfig(ctx context.Context) error
- func (c *Client) RetryBuild(ctx context.Context, id string) error
- func (c *Client) RetryService(ctx context.Context, appID, serviceName string) error
- func (c *Client) RevokeInvitation(ctx context.Context, invitationID string) error
- func (c *Client) RollbackDeployment(ctx context.Context, id string) (*Deployment, error)
- func (c *Client) SaveGitHubConfig(ctx context.Context, configType, clientID, clientSecret string) error
- func (c *Client) StartService(ctx context.Context, appID, serviceName string) error
- func (c *Client) StopService(ctx context.Context, appID, serviceName string) error
- func (c *Client) UpdateApp(ctx context.Context, id string, req UpdateAppRequest) (*App, error)
- func (c *Client) UpdateOrg(ctx context.Context, orgID string, req UpdateOrgRequest) (*Organization, error)
- func (c *Client) UpdateService(ctx context.Context, appID, serviceName string, svc CreateServiceRequest) (*Service, error)
- func (c *Client) UpdateServicePort(ctx context.Context, appID, serviceName string, port int) (*Service, error)
- func (c *Client) UpdateSettings(ctx context.Context, settings map[string]string) error
- func (c *Client) UpdateUserProfile(ctx context.Context, name, avatarURL string) (*store.User, error)
- func (c *Client) WithOrg(orgID string) *Client
- func (c *Client) WithToken(token string) *Client
- type ConfigCache
- func (cc *ConfigCache) Get(ctx context.Context, client *Client) (*PlatformConfig, error)
- func (cc *ConfigCache) GetDefaultPort(ctx context.Context, client *Client, serviceType string) int
- func (cc *ConfigCache) GetDomain(ctx context.Context, client *Client) string
- func (cc *ConfigCache) GetStatusMapping(ctx context.Context, client *Client, status string) *StatusMapping
- func (cc *ConfigCache) GetSupportedDBTypes(ctx context.Context, client *Client) []DatabaseTypeDef
- func (cc *ConfigCache) Invalidate()
- type CreateAppRequest
- type CreateOrgRequest
- type CreateSecretRequest
- type CreateServiceRequest
- type DashboardStats
- type DashboardStatsResponse
- type DatabaseConfig
- type DatabaseTypeDef
- type Deployment
- type Domain
- type GitHubConfigStatus
- type GitHubInstallation
- type GitHubRepository
- type Invitation
- type Log
- type LoginRequest
- type Node
- type NodeHealth
- type NodeHealthSummary
- type NodeResources
- type Organization
- type PlatformConfig
- type RecentDeployment
- type RegisterRequest
- type ResourceSpec
- type Secret
- type Service
- type StatusMapping
- type UpdateAppRequest
- type UpdateInfo
- type UpdateOrgRequest
- type UserInfo
Constants ¶
const DefaultConfigCacheTTL = 5 * time.Minute
DefaultConfigCacheTTL is the default time-to-live for cached configuration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
OwnerID string `json:"owner_id"`
Name string `json:"name"`
Description string `json:"description"`
IconURL string `json:"icon_url"`
Services []Service `json:"services"`
Version int `json:"version"` // For optimistic locking
Domains []string `json:"domains"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
App represents an application from the API.
type AuthResponse ¶
AuthResponse is returned from login/register.
type Build ¶
type Build struct {
ID string `json:"id"`
AppID string `json:"app_id"`
DeploymentID string `json:"deployment_id"`
Status string `json:"status"`
Strategy string `json:"build_strategy,omitempty"`
Logs string `json:"logs,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Build represents a build job from the API.
type BuildConfig ¶
type BuildConfig struct {
BuildCommand string `json:"build_command,omitempty"`
StartCommand string `json:"start_command,omitempty"`
EntryPoint string `json:"entry_point,omitempty"`
EnvVars map[string]string `json:"environment_vars,omitempty"`
// Go-specific build configuration fields
// **Validates: Requirements 17.1**
BuildTags []string `json:"build_tags,omitempty"` // Go build tags (e.g., ["integration", "debug"])
// **Validates: Requirements 18.1**
Ldflags string `json:"ldflags,omitempty"` // Custom ldflags for Go linker (e.g., "-X main.version=1.0.0")
// **Validates: Requirements 16.5**
CGOEnabled *bool `json:"cgo_enabled,omitempty"` // Explicit CGO control (nil = auto-detect)
// **Validates: Requirements 21.1, 21.2**
PreBuildCommands []string `json:"pre_build_commands,omitempty"` // Commands to run before build
PostBuildCommands []string `json:"post_build_commands,omitempty"` // Commands to run after build
// Go workspace support **Validates: Requirements 22.1, 22.2, 22.3, 22.4**
IsWorkspace bool `json:"is_workspace,omitempty"` // True if go.work file detected
WorkspaceModule string `json:"workspace_module,omitempty"` // Selected module to build in workspace
}
BuildConfig contains strategy-specific configuration options.
type BuildStrategy ¶
type BuildStrategy string
BuildStrategy represents the method used to build an application.
const ( BuildStrategyFlake BuildStrategy = "flake" // Use existing flake.nix BuildStrategyAutoGo BuildStrategy = "auto-go" // Generate flake for Go BuildStrategyAutoRust BuildStrategy = "auto-rust" // Generate flake for Rust BuildStrategyAutoNode BuildStrategy = "auto-node" // Generate flake for Node.js BuildStrategyAutoPython BuildStrategy = "auto-python" // Generate flake for Python BuildStrategyDockerfile BuildStrategy = "dockerfile" // Build from Dockerfile BuildStrategyNixpacks BuildStrategy = "nixpacks" // Use Nixpacks BuildStrategyAuto BuildStrategy = "auto" // Auto-detect )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an API client for the control-plane.
func (*Client) AcceptInvitation ¶
func (c *Client) AcceptInvitation(ctx context.Context, token, password string) (*AuthResponse, error)
AcceptInvitation accepts an invitation and creates a user (public).
func (*Client) ApplyUpdate ¶ added in v0.0.9
ApplyUpdate triggers an update to the specified version.
func (*Client) CanRegister ¶
CanRegister checks if public registration is allowed (no owner exists yet).
func (*Client) CheckForUpdates ¶ added in v0.0.9
func (c *Client) CheckForUpdates(ctx context.Context) (*UpdateInfo, error)
CheckForUpdates checks if a new version is available.
func (*Client) CheckHealth ¶
CheckHealth checks if the API server is healthy by calling the /health endpoint.
func (*Client) CreateDomain ¶
func (c *Client) CreateDomain(ctx context.Context, appID, service, domain string, isWildcard bool) (*Domain, error)
CreateDomain creates a new domain mapping.
func (*Client) CreateInvitation ¶
CreateInvitation creates a new invitation (admin only).
func (*Client) CreateOrg ¶
func (c *Client) CreateOrg(ctx context.Context, req CreateOrgRequest) (*Organization, error)
CreateOrg creates a new organization.
func (*Client) CreateSecret ¶
CreateSecret adds a secret to an app.
func (*Client) CreateService ¶
func (c *Client) CreateService(ctx context.Context, appID string, svc CreateServiceRequest) (*Service, error)
CreateService adds a service to an app.
func (*Client) DeleteDomain ¶
DeleteDomain removes a domain mapping.
func (*Client) DeleteSecret ¶
DeleteSecret removes a secret from an app.
func (*Client) DeleteService ¶
DeleteService removes a service from an app.
func (*Client) DeleteUser ¶
DeleteUser removes a user (admin only).
func (*Client) GetAppLogs ¶
GetAppLogs fetches logs for an app.
func (*Client) GetBuildByDeployment ¶
GetBuildByDeployment fetches a build by its deployment ID.
func (*Client) GetConfig ¶
func (c *Client) GetConfig(ctx context.Context) (*PlatformConfig, error)
GetConfig fetches platform configuration from the backend.
func (*Client) GetDashboardData ¶
func (c *Client) GetDashboardData(ctx context.Context) (*DashboardStats, []RecentDeployment, []NodeHealth, error)
GetDashboardData fetches dashboard data from the backend statistics endpoint. This uses the backend as the source of truth for statistics instead of calculating client-side. **Validates: Requirements 3.1, 3.2, 3.3**
func (*Client) GetDashboardStats ¶
func (c *Client) GetDashboardStats(ctx context.Context) (*DashboardStatsResponse, error)
GetDashboardStats fetches pre-calculated dashboard statistics from the backend.
func (*Client) GetDeployment ¶
func (*Client) GetGitHubConfig ¶
func (c *Client) GetGitHubConfig(ctx context.Context) (*GitHubConfigStatus, error)
GetGitHubConfig checks if the GitHub App is configured.
func (*Client) GetGitHubInstallURL ¶
GetGitHubInstallURL gets the URL to install the GitHub App.
func (*Client) GetGitHubOAuthURL ¶
GetGitHubOAuthURL gets the URL to start standard GitHub OAuth authorization.
func (*Client) GetGitHubSetupURL ¶
GetGitHubSetupURL returns the path to start GitHub App creation. Note: This endpoint now returns HTML for a POST manifest flow, so we don't fetch it as JSON.
func (*Client) GetInvitationByToken ¶
GetInvitationByToken fetches invitation details by token (public).
func (*Client) GetOrgBySlug ¶
GetOrgBySlug fetches an organization by slug.
func (*Client) GetRaw ¶
GetRaw performs a GET request and returns the raw response body as a byte slice.
func (*Client) GetServiceLogs ¶
GetServiceLogs fetches logs for a specific service within an app.
func (*Client) GetSettings ¶
GetSettings fetches global settings.
func (*Client) GetUserProfile ¶
GetUserProfile retrieves the current user's profile.
func (*Client) ListAllDomains ¶
ListAllDomains retrieves all domains across all applications.
func (*Client) ListAppDeployments ¶
ListAppDeployments fetches all deployments for an app.
func (*Client) ListBuilds ¶
ListBuilds retrieves all builds for the user from the API.
func (*Client) ListDeployments ¶
func (c *Client) ListDeployments(ctx context.Context) ([]Deployment, error)
GetDeployment fetches a single deployment by ID. ListDeployments retrieves all deployments for the user.
func (*Client) ListGitHubInstallations ¶
func (c *Client) ListGitHubInstallations(ctx context.Context) ([]GitHubInstallation, error)
ListGitHubInstallations lists all GitHub App installations.
func (*Client) ListGitHubRepos ¶
func (c *Client) ListGitHubRepos(ctx context.Context) ([]GitHubRepository, error)
ListGitHubRepos lists repositories across all user installations.
func (*Client) ListInvitations ¶
func (c *Client) ListInvitations(ctx context.Context) ([]Invitation, error)
ListInvitations fetches all invitations (admin only).
func (*Client) ListOrgs ¶
func (c *Client) ListOrgs(ctx context.Context) ([]Organization, error)
ListOrgs fetches all organizations for the current user.
func (*Client) ListSecrets ¶
ListSecrets fetches all secrets for an app.
func (*Client) ReloadService ¶
ReloadService restarts a service without rebuilding.
func (*Client) ResetGitHubConfig ¶
ResetGitHubConfig clears the GitHub configuration and all associated data.
func (*Client) RetryBuild ¶
RetryBuild retries a failed build.
func (*Client) RetryService ¶
RetryService retries a failed deployment.
func (*Client) RevokeInvitation ¶
RevokeInvitation revokes an invitation (admin only).
func (*Client) RollbackDeployment ¶
RollbackDeployment rolls back a deployment.
func (*Client) SaveGitHubConfig ¶
func (c *Client) SaveGitHubConfig(ctx context.Context, configType, clientID, clientSecret string) error
SaveGitHubConfig saves the GitHub configuration (for manual OAuth).
func (*Client) StartService ¶
StartService starts a stopped service.
func (*Client) StopService ¶
StopService stops a running service.
func (*Client) UpdateOrg ¶
func (c *Client) UpdateOrg(ctx context.Context, orgID string, req UpdateOrgRequest) (*Organization, error)
UpdateOrg updates an organization.
func (*Client) UpdateService ¶
func (c *Client) UpdateService(ctx context.Context, appID, serviceName string, svc CreateServiceRequest) (*Service, error)
UpdateService updates an existing service.
func (*Client) UpdateServicePort ¶
func (c *Client) UpdateServicePort(ctx context.Context, appID, serviceName string, port int) (*Service, error)
UpdateServicePort updates a service's port configuration.
func (*Client) UpdateSettings ¶
UpdateSettings updates global settings.
func (*Client) UpdateUserProfile ¶
func (c *Client) UpdateUserProfile(ctx context.Context, name, avatarURL string) (*store.User, error)
UpdateUserProfile updates the current user's profile.
type ConfigCache ¶
type ConfigCache struct {
// contains filtered or unexported fields
}
ConfigCache provides thread-safe caching for platform configuration. This reduces API calls and improves performance for frequently accessed config values. **Validates: Requirements 4.1, 4.2, 4.3, 4.4**
func GetGlobalConfigCache ¶
func GetGlobalConfigCache() *ConfigCache
GetGlobalConfigCache returns the global config cache instance.
func NewConfigCache ¶
func NewConfigCache(ttl time.Duration) *ConfigCache
NewConfigCache creates a new configuration cache with the specified TTL.
func (*ConfigCache) Get ¶
func (cc *ConfigCache) Get(ctx context.Context, client *Client) (*PlatformConfig, error)
Get retrieves the cached configuration, fetching from the backend if expired or not cached.
func (*ConfigCache) GetDefaultPort ¶
GetDefaultPort returns the default port for a given service type from the cached config. Falls back to 8080 if the type is not found or config is unavailable. **Validates: Requirements 4.1**
func (*ConfigCache) GetDomain ¶
func (cc *ConfigCache) GetDomain(ctx context.Context, client *Client) string
GetDomain returns the platform domain from the cached config. Falls back to "localhost" if config is unavailable. **Validates: Requirements 4.2**
func (*ConfigCache) GetStatusMapping ¶
func (cc *ConfigCache) GetStatusMapping(ctx context.Context, client *Client, status string) *StatusMapping
GetStatusMapping returns the status mapping for a given status from the cached config. Returns nil if the status is not found or config is unavailable. **Validates: Requirements 4.3**
func (*ConfigCache) GetSupportedDBTypes ¶
func (cc *ConfigCache) GetSupportedDBTypes(ctx context.Context, client *Client) []DatabaseTypeDef
GetSupportedDBTypes returns the list of supported database types from the cached config. Returns an empty slice if config is unavailable. **Validates: Requirements 4.4**
func (*ConfigCache) Invalidate ¶
func (cc *ConfigCache) Invalidate()
Invalidate clears the cached configuration, forcing a refresh on next access.
type CreateAppRequest ¶
type CreateAppRequest struct {
Name string `json:"name"`
Description string `json:"description"`
IconURL string `json:"icon_url"`
}
CreateAppRequest is the request body for creating an app.
type CreateOrgRequest ¶
type CreateOrgRequest struct {
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Description string `json:"description,omitempty"`
IconURL string `json:"icon_url,omitempty"`
}
CreateOrgRequest is the request body for creating an organization.
type CreateSecretRequest ¶
CreateSecretRequest is the request body for creating a secret.
type CreateServiceRequest ¶
type CreateServiceRequest struct {
Name string `json:"name"`
SourceType string `json:"source_type"`
GitRepo string `json:"git_repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
FlakeURI string `json:"flake_uri,omitempty"`
BuildStrategy BuildStrategy `json:"build_strategy,omitempty"`
BuildConfig *BuildConfig `json:"build_config,omitempty"`
Database *DatabaseConfig `json:"database,omitempty"`
Resources *ResourceSpec `json:"resources,omitempty"` // Direct CPU/memory specification
Replicas int `json:"replicas"`
EnvVars map[string]string `json:"env_vars,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
}
CreateServiceRequest is the request body for creating a service.
type DashboardStats ¶
type DashboardStats struct {
TotalApps int
ActiveDeployments int
HealthyNodes int
RunningBuilds int
}
DashboardStats holds aggregated stats for the dashboard.
type DashboardStatsResponse ¶
type DashboardStatsResponse struct {
ActiveDeployments int `json:"active_deployments"`
TotalApps int `json:"total_apps"`
TotalServices int `json:"total_services"`
NodeHealth NodeHealthSummary `json:"node_health"`
}
DashboardStatsResponse holds pre-calculated dashboard statistics from the backend.
type DatabaseConfig ¶
DatabaseConfig represents a database configuration.
type DatabaseTypeDef ¶
type DatabaseTypeDef struct {
Type string `json:"type"`
Versions []string `json:"versions"`
DefaultVersion string `json:"default_version"`
}
DatabaseTypeDef defines a supported database type with its versions. **Validates: Requirements 4.4**
type Deployment ¶
type Deployment struct {
ID string `json:"id"`
AppID string `json:"app_id"`
ServiceName string `json:"service_name"`
Version int `json:"version"`
GitRef string `json:"git_ref"`
GitCommit string `json:"git_commit,omitempty"`
Status string `json:"status"`
NodeID string `json:"node_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Deployment represents a deployment from the API.
type Domain ¶
type Domain struct {
ID string `json:"id"`
AppID string `json:"app_id"`
Service string `json:"service"`
Domain string `json:"domain"`
IsWildcard bool `json:"is_wildcard"`
Verified bool `json:"verified"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Domain represents a custom domain mapping.
type GitHubConfigStatus ¶
type GitHubConfigStatus struct {
Configured bool `json:"configured"`
ConfigType string `json:"config_type,omitempty"` // "app" or "oauth"
AppID *int64 `json:"app_id,omitempty"`
Slug *string `json:"slug,omitempty"`
}
GitHubConfigStatus represents the configuration state of the GitHub integration.
type GitHubInstallation ¶
type GitHubInstallation struct {
ID int64 `json:"id"`
AccountLogin string `json:"account_login"`
AccountType string `json:"account_type"`
}
GitHubInstallation represents an installation of the GitHub App.
type GitHubRepository ¶
type GitHubRepository struct {
ID int64 `json:"id"`
Name string `json:"name"`
FullName string `json:"full_name"`
HTMLURL string `json:"html_url"`
Description string `json:"description"`
DefaultBranch string `json:"default_branch"`
}
GitHubRepository represents a repository from the GitHub API.
type Invitation ¶
type Invitation struct {
ID string `json:"id"`
Email string `json:"email"`
Token string `json:"token,omitempty"`
InvitedBy string `json:"invited_by"`
Role string `json:"role"`
Status string `json:"status"`
ExpiresAt string `json:"expires_at"`
AcceptedAt string `json:"accepted_at,omitempty"`
CreatedAt string `json:"created_at"`
}
Invitation represents an invitation to join the platform.
type Log ¶
type Log struct {
ID string `json:"id"`
DeploymentID string `json:"deployment_id"`
Source string `json:"source"`
Level string `json:"level"`
Message string `json:"message"`
Timestamp time.Time `json:"timestamp"`
}
Log represents a log entry.
type LoginRequest ¶
LoginRequest is the request body for login.
type Node ¶
type Node struct {
ID string `json:"id"`
Hostname string `json:"hostname"`
Address string `json:"address"`
Healthy bool `json:"healthy"`
Resources *NodeResources `json:"resources,omitempty"`
LastHeartbeat time.Time `json:"last_heartbeat"`
}
Node represents a compute node from the API.
type NodeHealth ¶
NodeHealth holds node health display data.
type NodeHealthSummary ¶
type NodeHealthSummary struct {
Total int `json:"total"`
Healthy int `json:"healthy"`
Unhealthy int `json:"unhealthy"`
}
NodeHealthSummary holds node health statistics.
type NodeResources ¶
type NodeResources struct {
CPUTotal float64 `json:"cpu_total"`
CPUAvailable float64 `json:"cpu_available"`
MemoryTotal int64 `json:"memory_total"`
MemoryAvailable int64 `json:"memory_available"`
}
NodeResources represents resource availability.
type Organization ¶
type Organization struct {
ID string `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
IconURL string `json:"icon_url"`
}
Organization represents an organization from the API.
type PlatformConfig ¶
type PlatformConfig struct {
Domain string `json:"domain"`
DefaultPorts map[string]int `json:"default_ports"`
StatusMappings map[string]StatusMapping `json:"status_mappings"`
DefaultResources ResourceSpec `json:"default_resources"`
SupportedDBTypes []DatabaseTypeDef `json:"supported_db_types"`
MaxServicesPerApp int `json:"max_services_per_app"`
}
PlatformConfig holds platform-wide configuration from the backend. **Validates: Requirements 4.1, 4.2, 4.3, 4.4**
type RecentDeployment ¶
RecentDeployment holds data for recent deployments display.
type RegisterRequest ¶
RegisterRequest is the request body for registration.
type ResourceSpec ¶
type ResourceSpec struct {
CPU string `json:"cpu"` // e.g., "0.5", "1", "2"
Memory string `json:"memory"` // e.g., "256Mi", "1Gi"
}
ResourceSpec represents direct resource allocation.
type Secret ¶
type Secret struct {
Key string `json:"key"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Secret represents a secret/env var for an app.
type Service ¶
type Service struct {
Name string `json:"name"`
SourceType string `json:"source_type"`
GitRepo string `json:"git_repo,omitempty"`
GitRef string `json:"git_ref,omitempty"`
FlakeURI string `json:"flake_uri,omitempty"`
Database *DatabaseConfig `json:"database,omitempty"`
// Build & Runtime
BuildStrategy BuildStrategy `json:"build_strategy,omitempty"`
BuildConfig *BuildConfig `json:"build_config,omitempty"`
Resources *ResourceSpec `json:"resources,omitempty"` // Direct CPU/memory specification
Replicas int `json:"replicas"`
Port int `json:"port,omitempty"` // Container port the app listens on
EnvVars map[string]string `json:"env_vars,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
}
Service represents a service within an app.
type StatusMapping ¶
type StatusMapping struct {
Label string `json:"label"`
Color string `json:"color"`
Icon string `json:"icon,omitempty"`
}
StatusMapping defines how a status should be displayed in the UI. **Validates: Requirements 4.3**
type UpdateAppRequest ¶
type UpdateAppRequest struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
IconURL *string `json:"icon_url,omitempty"`
Version int `json:"version"` // Required for optimistic locking
}
UpdateAppRequest is the request body for updating an app.
type UpdateInfo ¶ added in v0.0.9
type UpdateInfo struct {
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
UpdateAvailable bool `json:"update_available"`
ReleaseURL string `json:"release_url,omitempty"`
ReleaseNotes string `json:"release_notes,omitempty"`
PublishedAt string `json:"published_at,omitempty"`
}
UpdateInfo contains information about available updates.
type UpdateOrgRequest ¶
type UpdateOrgRequest struct {
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
Description string `json:"description,omitempty"`
IconURL string `json:"icon_url,omitempty"`
}
UpdateOrgRequest is the request body for updating an organization.
type UserInfo ¶
type UserInfo struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
Role string `json:"role"`
InvitedBy string `json:"invited_by,omitempty"`
CreatedAt int64 `json:"created_at"`
}
UserInfo represents a user in the system.