ink

package module
v0.0.0-...-3a5dacb Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

Ink Go SDK

Go client library for the Ink cloud platform.

Installation

go get github.com/mldotink/sdk-go

Usage

Create a client
import "github.com/mldotink/sdk-go"

client := ink.NewClient(ink.Config{
    APIKey: "dk_live_...", // https://ml.ink/account/api-keys
})
Deploy a service
result, err := client.CreateService(ctx, ink.CreateServiceInput{
    Name:   "my-api",
    Source: "image",
    Image:  "nginx:latest",
    Memory: "256Mi",
    VCPUs:  "0.25",
})
fmt.Println(result.ServiceID, result.Status)
Get service status
svc, err := client.GetService(ctx, serviceID)
fmt.Println(svc.Name, svc.Status)
List services in a workspace
services, err := client.ListServices(ctx, "my-workspace", "")
for _, s := range services {
    fmt.Println(s.Name, s.Status)
}
Update and redeploy a service
newImage := "nginx:1.27"
result, err := client.UpdateService(ctx, ink.UpdateServiceInput{
    ServiceID: serviceID,
    Image:     &newImage,
})
Set environment variables
err := client.SetSecrets(ctx, ink.SetSecretsInput{
    ServiceID: serviceID,
    EnvVars: []ink.EnvVar{
        {Key: "DATABASE_URL", Value: "postgres://..."},
        {Key: "API_KEY", Value: "secret"},
    },
})
Run a one-shot command
result, err := client.Exec(ctx, ink.ExecInput{ServiceID: serviceID}, "ls -la /app")
fmt.Printf("exit %d\n%s", result.ExitCode, result.Stdout)
Interactive shell session
import "github.com/mldotink/sdk-go/exec"

session, err := exec.Dial(ctx, client, serviceID)
if err != nil {
    log.Fatal(err)
}
defer session.Close()

go io.Copy(os.Stdout, session.Stdout())
go io.Copy(os.Stdout, session.Stderr())
io.Copy(session.Stdin(), os.Stdin)
session.Wait()
Deploy a template
result, err := client.DeployTemplate(ctx, ink.TemplateDeployInput{
    Template:      "postgres",
    WorkspaceSlug: "my-workspace",
    Variables: []ink.TemplateVariableValue{
        {Key: "POSTGRES_DB", Value: "mydb"},
    },
})
fmt.Println(result.TemplateInstanceID)
DNS management
zones, err := client.ListDNSZones(ctx, "my-workspace")
record, err := client.AddDNSRecord(ctx, "example.com", "api", "A", "1.2.3.4", 300, "my-workspace")
err = client.DeleteDNSRecord(ctx, "example.com", record.ID, "my-workspace")
Billing
breakdown, err := client.GetUsageBillBreakdown(ctx, "my-workspace")
fmt.Printf("Current bill: $%.2f\n", float64(breakdown.CurrentBillCents)/100)

API Reference

Services
Method Description
CreateService(ctx, CreateServiceInput) Deploy a new service
GetService(ctx, id) Get full service details
ListServices(ctx, workspaceSlug, projectSlug) List services
UpdateService(ctx, UpdateServiceInput) Reconfigure and redeploy
DeleteService(ctx, DeleteServiceInput) Permanently delete a service
Secrets
Method Description
SetSecrets(ctx, SetSecretsInput) Set environment variables
DeleteSecrets(ctx, DeleteSecretsInput) Remove environment variables
Exec
Method Description
Exec(ctx, ExecInput, command) Run a one-shot command (30s timeout)
ExecURL(ctx, serviceID) Get WebSocket URL for interactive shell
exec.Dial(ctx, client, serviceID) Open an interactive shell session
Workspaces
Method Description
ListWorkspaces(ctx) List workspaces the user belongs to
CreateWorkspace(ctx, name, slug, description) Create a workspace
DeleteWorkspace(ctx, id) Delete a workspace
ListWorkspaceMembers(ctx, workspaceSlug) List members
InviteToWorkspace(ctx, workspaceID, user, role) Invite a user
RemoveWorkspaceMember(ctx, workspaceID, userID) Remove a member
ListMyInvites(ctx) List pending invitations for the current user
AcceptInvite(ctx, inviteID) Accept an invitation
DeclineInvite(ctx, inviteID) Decline an invitation
RevokeInvite(ctx, inviteID) Cancel a pending invitation
Projects
Method Description
ListProjects(ctx, workspaceSlug) List projects
CreateProject(ctx, CreateProjectInput) Create a project
DeleteProject(ctx, slug, workspaceSlug) Delete a project
DNS
Method Description
ListDNSZones(ctx, workspaceSlug) List DNS zones
ListDNSRecords(ctx, zone, workspaceSlug) List records in a zone
AddDNSRecord(ctx, zone, name, type, content, ttl, workspaceSlug) Create a record
DeleteDNSRecord(ctx, zone, recordID, workspaceSlug) Delete a record
Domains
Method Description
AddDomain(ctx, serviceName, domain, project, workspaceSlug) Attach a custom domain
RemoveDomain(ctx, serviceName, project, workspaceSlug) Detach a custom domain
Templates
Method Description
ListTemplates(ctx, search) Browse available templates
DeployTemplate(ctx, TemplateDeployInput) Deploy a template
ListTemplateInstances(ctx, project, projectID, workspaceSlug) List deployed instances
Account & Billing
Method Description
GetAccountStatus(ctx) Current user details
GetUsageBillBreakdown(ctx, workspaceSlug) Current billing period breakdown
Observability
Method Description
GetLogs(ctx, LogsInput) Fetch service log entries
GetMetrics(ctx, serviceID, timeRange, maxDataPoints) CPU/memory/network metrics
Repos
Method Description
CreateRepo(ctx, CreateRepoInput) Create an internal git repo
GetRepoToken(ctx, GetRepoTokenInput) Get a short-lived push token
Chat
Method Description
SendChatMessage(ctx, workspaceSlug, channel, content) Post a message
ReadChat(ctx, workspaceSlug, channel, cursor, limit) Read messages

exec.Session methods

Method Description
Stdin() Writer for shell input
Stdout() Reader for shell stdout
Stderr() Reader for shell stderr
Resize(w, h) Send terminal resize
Wait() Block until session ends
Close() Terminate the session

Documentation

Index

Constants

View Source
const (
	DefaultBaseURL = "https://api.ml.ink/graphql"
	DefaultExecURL = "wss://exec-eu-central-1.ml.ink"
)

Variables

Functions

This section is empty.

Types

type AccountStatus

type AccountStatus struct {
	ID               string   `json:"id"`
	Email            string   `json:"email"`
	DisplayName      string   `json:"displayName"`
	Username         string   `json:"username"`
	GitHubUsername   string   `json:"githubUsername"`
	HasGitHubOAuth   bool     `json:"hasGitHubOAuth"`
	HasGitHubApp     bool     `json:"hasGitHubApp"`
	DefaultWorkspace string   `json:"defaultWorkspace"`
	SubscriptionTier string   `json:"subscriptionTier"`
	GitHubScopes     []string `json:"githubScopes"`
}

type AddDomainResult

type AddDomainResult struct {
	ServiceID string `json:"serviceId"`
	Domain    string `json:"domain"`
	Status    string `json:"status"`
	Message   string `json:"message"`
}

type BucketMountInput

type BucketMountInput struct {
	Name         string `json:"name"`
	MountPath    string `json:"mountPath,omitempty"`
	Mode         string `json:"mode,omitempty"`
	Prefix       string `json:"prefix,omitempty"`
	SyncInterval int    `json:"syncInterval,omitempty"`
}

type ChatMessage

type ChatMessage struct {
	Seq        int    `json:"seq"`
	MessageID  string `json:"messageId"`
	SenderID   string `json:"senderId"`
	SenderName string `json:"senderName"`
	Channel    string `json:"channel"`
	Content    string `json:"content"`
	Metadata   string `json:"metadata"`
	CreatedAt  string `json:"createdAt"`
}

type Client

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

func NewClient

func NewClient(cfg Config) *Client

func (*Client) AcceptInvite

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

func (*Client) AddDNSRecord

func (c *Client) AddDNSRecord(ctx context.Context, zone, name, recordType, content string, ttl int, workspaceSlug string) (*ZoneRecord, error)

func (*Client) AddDomain

func (c *Client) AddDomain(ctx context.Context, serviceName, domain, project, workspaceSlug string) (*AddDomainResult, error)

func (*Client) CreateProject

func (c *Client) CreateProject(ctx context.Context, input CreateProjectInput) (*Project, error)

func (*Client) CreateRepo

func (c *Client) CreateRepo(ctx context.Context, input CreateRepoInput) (*CreateRepoResult, error)

func (*Client) CreateService

func (c *Client) CreateService(ctx context.Context, input CreateServiceInput) (*CreateServiceResult, error)

func (*Client) CreateWorkspace

func (c *Client) CreateWorkspace(ctx context.Context, name, slug, description string) (*Workspace, error)

func (*Client) DeclineInvite

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

func (*Client) DeleteDNSRecord

func (c *Client) DeleteDNSRecord(ctx context.Context, zone, recordID, workspaceSlug string) error

func (*Client) DeleteProject

func (c *Client) DeleteProject(ctx context.Context, slug, workspaceSlug string) error

func (*Client) DeleteSecrets

func (c *Client) DeleteSecrets(ctx context.Context, input DeleteSecretsInput) error

func (*Client) DeleteService

func (c *Client) DeleteService(ctx context.Context, input DeleteServiceInput) (*DeleteServiceResult, error)

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(ctx context.Context, name, projectSlug, workspaceSlug string) error

func (*Client) DeleteWorkspace

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

func (*Client) DeployTemplate

func (c *Client) DeployTemplate(ctx context.Context, input TemplateDeployInput) (*TemplateDeployResult, error)

func (*Client) Exec

func (c *Client) Exec(ctx context.Context, target ExecInput, command string) (*ExecResult, error)

func (*Client) ExecBaseURL

func (c *Client) ExecBaseURL() string

func (*Client) ExecURL

func (c *Client) ExecURL(ctx context.Context, serviceID string) (*ExecSession, error)

func (*Client) GetAccountStatus

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

func (*Client) GetLogs

func (c *Client) GetLogs(ctx context.Context, input LogsInput) (*LogsResult, error)

func (*Client) GetMetrics

func (c *Client) GetMetrics(ctx context.Context, serviceID string, timeRange MetricTimeRange, maxDataPoints int) (*ServiceMetrics, error)

func (*Client) GetRepoToken

func (c *Client) GetRepoToken(ctx context.Context, input GetRepoTokenInput) (*GetRepoTokenResult, error)

func (*Client) GetService

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

func (*Client) GetServiceByName

func (c *Client) GetServiceByName(ctx context.Context, name, workspaceSlug, projectSlug string) (*Service, error)

func (*Client) GetUsageBillBreakdown

func (c *Client) GetUsageBillBreakdown(ctx context.Context, workspaceSlug string) (*UsageBillBreakdown, error)

func (*Client) InviteToWorkspace

func (c *Client) InviteToWorkspace(ctx context.Context, workspaceID, user, role string) (*WorkspaceInvite, error)

func (*Client) ListDNSRecords

func (c *Client) ListDNSRecords(ctx context.Context, zone, workspaceSlug string) ([]ZoneRecord, error)

func (*Client) ListDNSZones

func (c *Client) ListDNSZones(ctx context.Context, workspaceSlug string) ([]DNSZone, error)

func (*Client) ListMyInvites

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

func (*Client) ListProjects

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

func (*Client) ListServices

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

func (*Client) ListTemplateInstances

func (c *Client) ListTemplateInstances(ctx context.Context, project, projectID, workspaceSlug string) ([]TemplateInstance, error)

func (*Client) ListTemplates

func (c *Client) ListTemplates(ctx context.Context, search string) ([]Template, error)

func (*Client) ListVolumes

func (c *Client) ListVolumes(ctx context.Context, workspaceSlug, projectSlug string) ([]VolumeInfo, error)

func (*Client) ListWorkspaceInvites

func (c *Client) ListWorkspaceInvites(ctx context.Context, workspaceSlug string) ([]WorkspaceInvite, error)

func (*Client) ListWorkspaceMembers

func (c *Client) ListWorkspaceMembers(ctx context.Context, workspaceSlug string) ([]WorkspaceMember, error)

func (*Client) ListWorkspaces

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

func (*Client) ReadChat

func (c *Client) ReadChat(ctx context.Context, workspaceSlug, channel string, cursor, limit int) (*ReadChatResult, error)

func (*Client) RemoveDomain

func (c *Client) RemoveDomain(ctx context.Context, serviceName, project, workspaceSlug string) (*RemoveDomainResult, error)

func (*Client) RemoveWorkspaceMember

func (c *Client) RemoveWorkspaceMember(ctx context.Context, workspaceID, userID string) error

func (*Client) RevokeInvite

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

func (*Client) SendChatMessage

func (c *Client) SendChatMessage(ctx context.Context, workspaceSlug, channel, content string) (*SendChatResult, error)

func (*Client) SetSecrets

func (c *Client) SetSecrets(ctx context.Context, input SetSecretsInput) error

func (*Client) UpdateService

func (c *Client) UpdateService(ctx context.Context, input UpdateServiceInput) (*UpdateServiceResult, error)

type Config

type Config struct {
	APIKey     string
	BaseURL    string
	ExecURL    string
	HTTPClient *http.Client
}

type CreateProjectInput

type CreateProjectInput struct {
	Name          string `json:"name"`
	WorkspaceSlug string `json:"workspaceSlug,omitempty"`
}

type CreateRepoInput

type CreateRepoInput struct {
	Name          string `json:"name"`
	Host          string `json:"host,omitempty"`
	Description   string `json:"description,omitempty"`
	Project       string `json:"project,omitempty"`
	WorkspaceSlug string `json:"workspaceSlug,omitempty"`
}

type CreateRepoResult

type CreateRepoResult struct {
	Name      string `json:"name"`
	GitRemote string `json:"gitRemote"`
	ExpiresAt string `json:"expiresAt"`
	Message   string `json:"message"`
}

type CreateServiceInput

type CreateServiceInput struct {
	Name                    string             `json:"name,omitempty"`
	Subdomain               string             `json:"subdomain,omitempty"`
	Source                  string             `json:"source,omitempty"`
	Repo                    string             `json:"repo,omitempty"`
	Image                   string             `json:"image,omitempty"`
	Host                    string             `json:"host,omitempty"`
	Branch                  string             `json:"branch,omitempty"`
	Project                 string             `json:"project,omitempty"`
	WorkspaceSlug           string             `json:"workspaceSlug,omitempty"`
	BuildPack               string             `json:"buildPack,omitempty"`
	Ports                   []ServicePortInput `json:"ports,omitempty"`
	EnvVars                 []EnvVar           `json:"envVars,omitempty"`
	Memory                  string             `json:"memory,omitempty"`
	VCPUs                   string             `json:"vcpus,omitempty"`
	BuildCommand            string             `json:"buildCommand,omitempty"`
	StartCommand            string             `json:"startCommand,omitempty"`
	PublishDirectory        string             `json:"publishDirectory,omitempty"`
	RootDirectory           string             `json:"rootDirectory,omitempty"`
	DockerfilePath          string             `json:"dockerfilePath,omitempty"`
	Regions                 []string           `json:"regions,omitempty"`
	Volumes                 []VolumeSpec       `json:"volumes,omitempty"`
	Bucket                  *BucketMountInput  `json:"bucket,omitempty"`
	DestroyTimeoutSeconds   int                `json:"destroyTimeoutSeconds,omitempty"`
	TeardownEnabled         bool               `json:"teardownEnabled,omitempty"`
	TeardownOverlapSeconds  *int               `json:"teardownOverlapSeconds,omitempty"`
	TeardownDrainingSeconds *int               `json:"teardownDrainingSeconds,omitempty"`
}

type CreateServiceResult

type CreateServiceResult struct {
	ServiceID string        `json:"serviceId"`
	Name      string        `json:"name"`
	Status    string        `json:"status"`
	Repo      string        `json:"repo"`
	Ports     []ServicePort `json:"ports"`
}

type DNSZone

type DNSZone struct {
	ID        string `json:"id"`
	Zone      string `json:"zone"`
	Status    string `json:"status"`
	Error     string `json:"error"`
	CreatedAt string `json:"createdAt"`
}

type DeleteSecretsInput

type DeleteSecretsInput struct {
	Name          string   `json:"name,omitempty"`
	ServiceID     string   `json:"serviceId,omitempty"`
	Project       string   `json:"project,omitempty"`
	ProjectID     string   `json:"projectId,omitempty"`
	WorkspaceSlug string   `json:"workspaceSlug,omitempty"`
	Keys          []string `json:"keys"`
}

type DeleteServiceInput

type DeleteServiceInput struct {
	Name          string `json:"name,omitempty"`
	ServiceID     string `json:"serviceId,omitempty"`
	Project       string `json:"project,omitempty"`
	ProjectID     string `json:"projectId,omitempty"`
	WorkspaceSlug string `json:"workspaceSlug,omitempty"`
}

type DeleteServiceResult

type DeleteServiceResult struct {
	ServiceID string `json:"serviceId"`
	Name      string `json:"name"`
	Message   string `json:"message"`
}

type EnvVar

type EnvVar struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Error

type Error struct {
	Message    string         `json:"message"`
	Path       []string       `json:"path"`
	Extensions map[string]any `json:"extensions"`
}

func (*Error) Error

func (e *Error) Error() string

type Errors

type Errors []*Error

func (Errors) Error

func (e Errors) Error() string

type ExecInput

type ExecInput struct {
	ServiceID     string
	Name          string
	Project       string
	WorkspaceSlug string
}

type ExecResult

type ExecResult struct {
	ExitCode int    `json:"exitCode"`
	Stdout   string `json:"stdout"`
	Stderr   string `json:"stderr"`
}

type ExecSession

type ExecSession struct {
	URL       string `json:"url"`
	Token     string `json:"token"`
	ServiceID string `json:"serviceId"`
}

type GetRepoTokenInput

type GetRepoTokenInput struct {
	Name          string `json:"name"`
	Host          string `json:"host,omitempty"`
	WorkspaceSlug string `json:"workspaceSlug,omitempty"`
}

type GetRepoTokenResult

type GetRepoTokenResult struct {
	GitRemote string `json:"gitRemote"`
	ExpiresAt string `json:"expiresAt"`
}

type LogEntry

type LogEntry struct {
	Timestamp  string `json:"timestamp"`
	Level      string `json:"level"`
	Message    string `json:"message"`
	Attributes string `json:"attributes"`
}

type LogType

type LogType = string
const (
	LogTypeBuild   LogType = "BUILD"
	LogTypeRuntime LogType = "RUNTIME"
)

type LogsInput

type LogsInput struct {
	ServiceID string  `json:"serviceId"`
	LogType   LogType `json:"logType"`
	StartTime string  `json:"startTime,omitempty"`
	EndTime   string  `json:"endTime,omitempty"`
	Query     string  `json:"query,omitempty"`
	Limit     int     `json:"limit,omitempty"`
}

type LogsResult

type LogsResult struct {
	Entries []LogEntry `json:"entries"`
	HasMore bool       `json:"hasMore"`
}

type MetricDataPoint

type MetricDataPoint struct {
	Timestamp string  `json:"timestamp"`
	Value     float64 `json:"value"`
}

type MetricSeries

type MetricSeries struct {
	Metric     string            `json:"metric"`
	DataPoints []MetricDataPoint `json:"dataPoints"`
}

type MetricTimeRange

type MetricTimeRange string
const (
	MetricTimeRangeFiveMinutes     MetricTimeRange = "FIVE_MINUTES"
	MetricTimeRangeOneHour         MetricTimeRange = "ONE_HOUR"
	MetricTimeRangeSixHours        MetricTimeRange = "SIX_HOURS"
	MetricTimeRangeTwentyFourHours MetricTimeRange = "TWENTY_FOUR_HOURS"
	MetricTimeRangeSevenDays       MetricTimeRange = "SEVEN_DAYS"
	MetricTimeRangeThirtyDays      MetricTimeRange = "THIRTY_DAYS"
)

type Project

type Project struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Slug      string `json:"slug"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

type ReadChatResult

type ReadChatResult struct {
	Messages   []ChatMessage `json:"messages"`
	NextCursor int           `json:"nextCursor"`
	HasMore    bool          `json:"hasMore"`
}

type RemoveDomainResult

type RemoveDomainResult struct {
	ServiceID string `json:"serviceId"`
	Message   string `json:"message"`
}

type SendChatResult

type SendChatResult struct {
	Seq       int    `json:"seq"`
	MessageID string `json:"messageId"`
}

type Service

type Service struct {
	ID                      string        `json:"id"`
	ProjectID               string        `json:"projectId"`
	Name                    string        `json:"name"`
	Subdomain               string        `json:"subdomain"`
	Source                  string        `json:"source"`
	Repo                    string        `json:"repo"`
	Image                   string        `json:"image"`
	Branch                  string        `json:"branch"`
	Status                  string        `json:"status"`
	ErrorMessage            string        `json:"errorMessage"`
	EnvVars                 []EnvVar      `json:"envVars"`
	Ports                   []ServicePort `json:"ports"`
	GitProvider             string        `json:"gitProvider"`
	CommitHash              string        `json:"commitHash"`
	Memory                  string        `json:"memory"`
	VCPUs                   string        `json:"vcpus"`
	CustomDomain            string        `json:"customDomain"`
	CustomDomainStatus      string        `json:"customDomainStatus"`
	BuildPack               string        `json:"buildPack"`
	BuildCommand            string        `json:"buildCommand"`
	StartCommand            string        `json:"startCommand"`
	PublishDirectory        string        `json:"publishDirectory"`
	RootDirectory           string        `json:"rootDirectory"`
	DockerfilePath          string        `json:"dockerfilePath"`
	TeardownEnabled         bool          `json:"teardownEnabled"`
	TeardownOverlapSeconds  *int          `json:"teardownOverlapSeconds"`
	TeardownDrainingSeconds *int          `json:"teardownDrainingSeconds"`
	DestroyTimeoutSeconds   int           `json:"destroyTimeoutSeconds"`
	CreatedAt               string        `json:"createdAt"`
	UpdatedAt               string        `json:"updatedAt"`
}

type ServiceMetrics

type ServiceMetrics struct {
	CPUUsage                   MetricSeries `json:"cpuUsage"`
	MemoryUsageMB              MetricSeries `json:"memoryUsageMB"`
	NetworkReceiveBytesPerSec  MetricSeries `json:"networkReceiveBytesPerSec"`
	NetworkTransmitBytesPerSec MetricSeries `json:"networkTransmitBytesPerSec"`
	MemoryLimitMB              float64      `json:"memoryLimitMB"`
	CPULimitVCPUs              float64      `json:"cpuLimitVCPUs"`
	DiskUsageMB                MetricSeries `json:"diskUsageMB"`
	VolumeSizeGi               int          `json:"volumeSizeGi"`
}

type ServicePort

type ServicePort struct {
	Name             string `json:"name"`
	Port             string `json:"port"`
	Protocol         string `json:"protocol"`
	Visibility       string `json:"visibility"`
	InternalEndpoint string `json:"internalEndpoint"`
	PublicEndpoint   string `json:"publicEndpoint"`
}

type ServicePortInput

type ServicePortInput struct {
	Name       string `json:"name"`
	Port       int    `json:"port"`
	Protocol   string `json:"protocol"`
	Visibility string `json:"visibility"`
}

type SetSecretsInput

type SetSecretsInput struct {
	Name          string   `json:"name,omitempty"`
	ServiceID     string   `json:"serviceId,omitempty"`
	Project       string   `json:"project,omitempty"`
	ProjectID     string   `json:"projectId,omitempty"`
	WorkspaceSlug string   `json:"workspaceSlug,omitempty"`
	EnvVars       []EnvVar `json:"envVars"`
	Replace       bool     `json:"replace,omitempty"`
}

type SetSecretsResult

type SetSecretsResult struct {
	ServiceID string `json:"serviceId"`
	Name      string `json:"name"`
	Status    string `json:"status"`
}

type Template

type Template struct {
	Slug        string             `json:"slug"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Tags        []string           `json:"tags"`
	Icon        string             `json:"icon"`
	Variables   []TemplateVariable `json:"variables"`
	Services    []TemplateService  `json:"services"`
	Outputs     []TemplateOutput   `json:"outputs"`
}

type TemplateDeployInput

type TemplateDeployInput struct {
	Template      string                  `json:"template"`
	Name          string                  `json:"name"`
	WorkspaceSlug string                  `json:"workspaceSlug,omitempty"`
	Project       string                  `json:"project,omitempty"`
	Variables     []TemplateVariableValue `json:"variables,omitempty"`
}

type TemplateDeployResult

type TemplateDeployResult struct {
	TemplateInstanceID string                    `json:"templateInstanceId"`
	ProjectID          string                    `json:"projectId"`
	Services           []TemplateDeployedService `json:"services"`
	Outputs            []TemplateDeployedOutput  `json:"outputs"`
}

type TemplateDeployedOutput

type TemplateDeployedOutput struct {
	Key         string `json:"key"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Kind        string `json:"kind"`
	Sensitive   bool   `json:"sensitive"`
	Value       string `json:"value"`
}

type TemplateDeployedService

type TemplateDeployedService struct {
	ServiceID string                    `json:"serviceId"`
	Key       string                    `json:"key"`
	Name      string                    `json:"name"`
	Status    string                    `json:"status"`
	Endpoints []TemplateServiceEndpoint `json:"endpoints"`
}

type TemplateInstance

type TemplateInstance struct {
	ID           string                    `json:"id"`
	TemplateSlug string                    `json:"templateSlug"`
	ProjectID    string                    `json:"projectId"`
	Name         string                    `json:"name"`
	Status       string                    `json:"status"`
	Services     []TemplateDeployedService `json:"services"`
	Outputs      []TemplateDeployedOutput  `json:"outputs"`
	CreatedAt    string                    `json:"createdAt"`
}

type TemplateOutput

type TemplateOutput struct {
	Key         string `json:"key"`
	Label       string `json:"label"`
	Description string `json:"description"`
	Kind        string `json:"kind"`
	Sensitive   bool   `json:"sensitive"`
}

type TemplateService

type TemplateService struct {
	Key    string `json:"key"`
	Name   string `json:"name"`
	Source string `json:"source"`
	Image  string `json:"image"`
	Memory string `json:"memory"`
	VCPUs  string `json:"vcpus"`
}

type TemplateServiceEndpoint

type TemplateServiceEndpoint struct {
	Name             string `json:"name"`
	Port             string `json:"port"`
	Protocol         string `json:"protocol"`
	Visibility       string `json:"visibility"`
	InternalEndpoint string `json:"internalEndpoint"`
	PublicEndpoint   string `json:"publicEndpoint"`
}

type TemplateVariable

type TemplateVariable struct {
	Key          string   `json:"key"`
	Type         string   `json:"type"`
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Required     bool     `json:"required"`
	Sensitive    bool     `json:"sensitive"`
	DefaultValue string   `json:"defaultValue"`
	Options      []string `json:"options"`
}

type TemplateVariableValue

type TemplateVariableValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type UpdateServiceInput

type UpdateServiceInput struct {
	Name                    string             `json:"name,omitempty"`
	ServiceID               string             `json:"serviceId,omitempty"`
	Project                 string             `json:"project,omitempty"`
	ProjectID               string             `json:"projectId,omitempty"`
	WorkspaceSlug           string             `json:"workspaceSlug,omitempty"`
	Source                  *string            `json:"source,omitempty"`
	Image                   *string            `json:"image,omitempty"`
	Repo                    *string            `json:"repo,omitempty"`
	Host                    *string            `json:"host,omitempty"`
	Branch                  *string            `json:"branch,omitempty"`
	BuildPack               *string            `json:"buildPack,omitempty"`
	Memory                  *string            `json:"memory,omitempty"`
	VCPUs                   *string            `json:"vcpus,omitempty"`
	Ports                   []ServicePortInput `json:"ports,omitempty"`
	EnvVars                 []EnvVar           `json:"envVars,omitempty"`
	BuildCommand            *string            `json:"buildCommand,omitempty"`
	StartCommand            *string            `json:"startCommand,omitempty"`
	PublishDirectory        *string            `json:"publishDirectory,omitempty"`
	RootDirectory           *string            `json:"rootDirectory,omitempty"`
	DockerfilePath          *string            `json:"dockerfilePath,omitempty"`
	Volumes                 []VolumeSpec       `json:"volumes,omitempty"`
	Bucket                  *BucketMountInput  `json:"bucket,omitempty"`
	DestroyTimeoutSeconds   *int               `json:"destroyTimeoutSeconds,omitempty"`
	TeardownEnabled         *bool              `json:"teardownEnabled,omitempty"`
	TeardownOverlapSeconds  *int               `json:"teardownOverlapSeconds,omitempty"`
	TeardownDrainingSeconds *int               `json:"teardownDrainingSeconds,omitempty"`
}

type UpdateServiceResult

type UpdateServiceResult struct {
	ServiceID string `json:"serviceId"`
	Name      string `json:"name"`
	Status    string `json:"status"`
}

type UsageBillBreakdown

type UsageBillBreakdown struct {
	Memory             UsageLineItem `json:"memory"`
	CPU                UsageLineItem `json:"cpu"`
	Egress             UsageLineItem `json:"egress"`
	Subtotal           string        `json:"subtotal"`
	IncludedUsageCents int           `json:"includedUsageCents"`
	PlanFeeCents       int           `json:"planFeeCents"`
	CurrentBillCents   int           `json:"currentBillCents"`
	PeriodStart        string        `json:"periodStart"`
	PeriodEnd          string        `json:"periodEnd"`
}

type UsageLineItem

type UsageLineItem struct {
	Quantity   string `json:"quantity"`
	UnitPrice  string `json:"unitPrice"`
	Unit       string `json:"unit"`
	TotalCents int    `json:"totalCents"`
}

type VolumeInfo

type VolumeInfo struct {
	Name        string `json:"name"`
	MountPath   string `json:"mountPath"`
	SizeGi      int    `json:"sizeGi"`
	Status      string `json:"status"`
	DeleteAfter string `json:"deleteAfter"`
}

type VolumeSpec

type VolumeSpec struct {
	Name      string `json:"name"`
	MountPath string `json:"mountPath"`
	SizeGi    int    `json:"sizeGi,omitempty"`
}

type Workspace

type Workspace struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Slug      string `json:"slug"`
	IsDefault bool   `json:"isDefault"`
	Role      string `json:"role"`
	CreatedAt string `json:"createdAt"`
}

type WorkspaceInvite

type WorkspaceInvite struct {
	ID                 string `json:"id"`
	WorkspaceID        string `json:"workspaceId"`
	WorkspaceName      string `json:"workspaceName"`
	WorkspaceSlug      string `json:"workspaceSlug"`
	InviterDisplayName string `json:"inviterDisplayName"`
	InviteeDisplayName string `json:"inviteeDisplayName"`
	Role               string `json:"role"`
	Status             string `json:"status"`
	CreatedAt          string `json:"createdAt"`
}

type WorkspaceMember

type WorkspaceMember struct {
	ID          string `json:"id"`
	UserID      string `json:"userId"`
	Email       string `json:"email"`
	Username    string `json:"username"`
	DisplayName string `json:"displayName"`
	AvatarURL   string `json:"avatarUrl"`
	Role        string `json:"role"`
	JoinedAt    string `json:"joinedAt"`
}

type ZoneRecord

type ZoneRecord struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Type      string `json:"type"`
	Content   string `json:"content"`
	TTL       int    `json:"ttl"`
	Managed   bool   `json:"managed"`
	CreatedAt string `json:"createdAt"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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