cli

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetLinux   = targetLinux
	TargetMacOS   = targetMacOS
	TargetWindows = targetWindows
)

Variables

This section is empty.

Functions

func AcquireAttempts added in v0.6.0

func AcquireAttempts(keep bool) int

func AllocateDirectLeaseSlug added in v0.6.0

func AllocateDirectLeaseSlug(leaseID string, servers []Server) string

func AllowedEnv added in v0.6.0

func AllowedEnv(allow []string) map[string]string

func AsExitError

func AsExitError(err error, target *ExitError) bool

func Blank added in v0.6.0

func Blank(value, fallback string) string

func BootstrapAWSWindowsDesktop added in v0.6.0

func BootstrapAWSWindowsDesktop(ctx context.Context, cfg Config, target *SSHTarget, publicKey string, stderr io.Writer) error

func BootstrapWaitTimeout added in v0.6.0

func BootstrapWaitTimeout(cfg Config) time.Duration

func CheckSyncPreflight added in v0.6.0

func CheckSyncPreflight(manifest SyncManifest, cfg Config, force bool, stderr io.Writer) error

func ClaimLeaseForRepoProvider added in v0.6.0

func ClaimLeaseForRepoProvider(leaseID, slug, provider, repoRoot string, idleTimeout time.Duration, reclaim bool) error

func DeleteServer added in v0.6.0

func DeleteServer(ctx context.Context, cfg Config, server Server) error

func DirectLeaseLabels added in v0.6.0

func DirectLeaseLabels(cfg Config, leaseID, slug, provider, market string, keep bool, now time.Time) map[string]string

func DurationMinutesCeil added in v0.6.0

func DurationMinutesCeil(duration time.Duration) int

func EnsureAWSSSHCIDRs added in v0.6.0

func EnsureAWSSSHCIDRs(ctx context.Context, cfg *Config)

func EnsureTestboxKey added in v0.6.0

func EnsureTestboxKey(leaseID string) (string, string, error)

func EnsureTestboxKeyForConfig added in v0.6.0

func EnsureTestboxKeyForConfig(cfg Config, leaseID string) (string, string, error)

func FlagWasSet added in v0.6.0

func FlagWasSet(fs *flag.FlagSet, name string) bool

func IdleForString added in v0.6.0

func IdleForString(value string, now time.Time) string

func IsBootstrapWaitError added in v0.6.0

func IsBootstrapWaitError(err error) bool

func IsCanonicalLeaseID added in v0.6.0

func IsCanonicalLeaseID(value string) bool

func IsGCPNotFound added in v0.11.0

func IsGCPNotFound(err error) bool

func IsShellEnvAssignment added in v0.6.0

func IsShellEnvAssignment(word string) bool

func LeadingEnvAssignment added in v0.6.0

func LeadingEnvAssignment(command []string) bool

func LeaseLabelDurationDisplay added in v0.6.0

func LeaseLabelDurationDisplay(secondsValue, fallbackValue string) string

func LeaseLabelTime added in v0.6.0

func LeaseLabelTime(t time.Time) string

func LeaseLabelTimeDisplay added in v0.6.0

func LeaseLabelTimeDisplay(value string) string

func LeaseProviderName added in v0.6.0

func LeaseProviderName(leaseID, slug string) string

func MoveStoredTestboxKey added in v0.6.0

func MoveStoredTestboxKey(oldLeaseID, newLeaseID string) error

func NewLeaseID added in v0.6.0

func NewLeaseID() string

func NewLeaseSlug added in v0.6.0

func NewLeaseSlug(leaseID string) string

func NoProviderFlags added in v0.6.0

func NoProviderFlags() any

func NormalizeLeaseSlug added in v0.6.0

func NormalizeLeaseSlug(value string) string

func ParseServerID added in v0.6.0

func ParseServerID(s string) (int64, bool)

func ProviderKeyForLease added in v0.6.0

func ProviderKeyForLease(leaseID string) string

func RegisterProvider added in v0.6.0

func RegisterProvider(provider Provider)

func RejectDelegatedSyncOptions added in v0.6.0

func RejectDelegatedSyncOptions(provider string, req RunRequest) error

func RemoteJoin added in v0.6.0

func RemoteJoin(cfg Config, parts ...string) string

func RemoveLeaseClaim added in v0.6.0

func RemoveLeaseClaim(leaseID string)

func RemoveStoredTestboxKey added in v0.6.0

func RemoveStoredTestboxKey(leaseID string)

func Run

func Run(ctx context.Context, args []string) error

func ServerSlug added in v0.6.0

func ServerSlug(server Server) string

func ServerTypeForProviderClass added in v0.6.0

func ServerTypeForProviderClass(provider, class string) string

func ShellQuote added in v0.6.0

func ShellQuote(s string) string

func ShellScriptFromArgv added in v0.6.0

func ShellScriptFromArgv(command []string) string

func ShellWords added in v0.6.0

func ShellWords(words []string) []string

func ShouldCleanupServer added in v0.6.0

func ShouldCleanupServer(server Server, now time.Time) (bool, string)

func ShouldUseShell added in v0.6.0

func ShouldUseShell(command []string) bool

func StaticLease added in v0.6.0

func StaticLease(cfg Config) (Server, SSHTarget, string, error)

func SummarizeJSON added in v0.6.0

func SummarizeJSON(data []byte) string

func SyncExcludes added in v0.6.0

func SyncExcludes(root string, cfg Config) ([]string, error)

func TestboxKeyPath added in v0.6.0

func TestboxKeyPath(leaseID string) (string, error)

func TouchDirectLeaseLabels added in v0.6.0

func TouchDirectLeaseLabels(labels map[string]string, cfg Config, state string, now time.Time) map[string]string

func WaitForSSH added in v0.6.0

func WaitForSSH(ctx context.Context, target *SSHTarget, stderr io.Writer) error

func WaitForSSHReady added in v0.6.0

func WaitForSSHReady(ctx context.Context, target *SSHTarget, stderr io.Writer, phase string, timeout time.Duration) error

func WriteTimingJSON added in v0.6.0

func WriteTimingJSON(w io.Writer, report TimingReport) error

Types

type AWSClient

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

func NewAWSClient added in v0.6.0

func NewAWSClient(ctx context.Context, cfg Config) (*AWSClient, error)

func (*AWSClient) CreateServerWithFallback

func (c *AWSClient) CreateServerWithFallback(ctx context.Context, cfg Config, publicKey, leaseID, slug string, keep bool, logf func(string, ...any)) (Server, Config, error)

func (*AWSClient) DeleteSSHKey

func (c *AWSClient) DeleteSSHKey(ctx context.Context, name string) error

func (*AWSClient) DeleteServer

func (c *AWSClient) DeleteServer(ctx context.Context, id string) error

func (*AWSClient) EnsureSSHKey

func (c *AWSClient) EnsureSSHKey(ctx context.Context, name, publicKey string) error

func (*AWSClient) GetServer

func (c *AWSClient) GetServer(ctx context.Context, id string) (Server, error)

func (*AWSClient) ListCrabboxServers

func (c *AWSClient) ListCrabboxServers(ctx context.Context) ([]Server, error)

func (*AWSClient) SetTags

func (c *AWSClient) SetTags(ctx context.Context, id string, labels map[string]string) error

func (*AWSClient) SpotPlacementScores

func (c *AWSClient) SpotPlacementScores(ctx context.Context, cfg Config) ([]types.SpotPlacementScore, error)

func (*AWSClient) WaitForServerIP added in v0.6.0

func (c *AWSClient) WaitForServerIP(ctx context.Context, id string) (Server, error)

type AccessConfig added in v0.3.0

type AccessConfig struct {
	ClientID     string
	ClientSecret string
	Token        string
}

type AcquireRequest added in v0.6.0

type AcquireRequest struct {
	Repo    Repo
	Options LeaseOptions
	Keep    bool
	Reclaim bool
}

type ActionsConfig

type ActionsConfig struct {
	Repo          string
	Workflow      string
	Job           string
	Ref           string
	Fields        []string
	RunnerLabels  []string
	RunnerVersion string
	Ephemeral     bool
}

type App

type App struct {
	Stdout io.Writer
	Stderr io.Writer
}

func (App) Run

func (a App) Run(ctx context.Context, args []string) error

type AzureClient added in v0.8.0

type AzureClient struct {
	SubscriptionID string
	Location       string
	ResourceGroup  string
	VNet           string
	Subnet         string
	NSG            string
	SSHCIDRs       []string
	Image          azureImageRef
	SSHPort        string
	FallbackPorts  []string
	// contains filtered or unexported fields
}

func NewAzureClient added in v0.8.0

func NewAzureClient(ctx context.Context, cfg Config) (*AzureClient, error)

func (*AzureClient) CreateServerWithFallback added in v0.8.0

func (c *AzureClient) CreateServerWithFallback(ctx context.Context, cfg Config, publicKey, leaseID, slug string, keep bool, logf func(string, ...any)) (Server, Config, error)

func (*AzureClient) DeleteServer added in v0.8.0

func (c *AzureClient) DeleteServer(ctx context.Context, name string) error

func (*AzureClient) EnsureSharedInfra added in v0.8.0

func (c *AzureClient) EnsureSharedInfra(ctx context.Context) error

func (*AzureClient) GetServer added in v0.8.0

func (c *AzureClient) GetServer(ctx context.Context, name string) (Server, error)

func (*AzureClient) ListCrabboxServers added in v0.8.0

func (c *AzureClient) ListCrabboxServers(ctx context.Context) ([]Server, error)

func (*AzureClient) SetTags added in v0.8.0

func (c *AzureClient) SetTags(ctx context.Context, name string, labels map[string]string) error

func (*AzureClient) WaitForServerIP added in v0.8.0

func (c *AzureClient) WaitForServerIP(ctx context.Context, name string) (Server, error)

type Backend added in v0.6.0

type Backend interface {
	Spec() ProviderSpec
}

type BlacksmithConfig added in v0.2.0

type BlacksmithConfig struct {
	Org         string
	Workflow    string
	Job         string
	Ref         string
	IdleTimeout time.Duration
	Debug       bool
}

type CacheConfig

type CacheConfig struct {
	Pnpm           bool
	Npm            bool
	Docker         bool
	Git            bool
	MaxGB          int
	PurgeOnRelease bool
}

type CapacityConfig

type CapacityConfig struct {
	Market            string
	Strategy          string
	Fallback          string
	Regions           []string
	AvailabilityZones []string
	Hints             bool
}

type CapacityHint added in v0.6.0

type CapacityHint struct {
	Code         string   `json:"code"`
	Message      string   `json:"message"`
	Action       string   `json:"action,omitempty"`
	Region       string   `json:"region,omitempty"`
	Market       string   `json:"market,omitempty"`
	Class        string   `json:"class,omitempty"`
	ServerType   string   `json:"serverType,omitempty"`
	RegionsTried []string `json:"regionsTried,omitempty"`
}

type CleanupBackend added in v0.6.0

type CleanupBackend interface {
	Backend
	Cleanup(ctx context.Context, req CleanupRequest) error
}

type CleanupRequest added in v0.6.0

type CleanupRequest struct {
	Options LeaseOptions
	DryRun  bool
}

type Clock added in v0.6.0

type Clock interface {
	Now() time.Time
}

type CommandRunner added in v0.6.0

type CommandRunner interface {
	Run(ctx context.Context, req LocalCommandRequest) (LocalCommandResult, error)
}

type Config

type Config struct {
	Profile            string
	Provider           string
	TargetOS           string
	WindowsMode        string
	Desktop            bool
	Browser            bool
	Code               bool
	Network            NetworkMode
	Class              string
	ServerType         string
	ServerTypeExplicit bool
	Coordinator        string
	CoordToken         string
	CoordAdminToken    string
	Access             AccessConfig
	Location           string
	Image              string
	AWSRegion          string
	AWSAMI             string
	AWSSGID            string
	AWSSubnetID        string
	AWSProfile         string
	AWSRootGB          int32
	AWSSSHCIDRs        []string
	AWSMacHostID       string
	AzureSubscription  string
	AzureTenant        string
	AzureClientID      string
	AzureLocation      string
	AzureResourceGroup string
	AzureImage         string
	AzureVNet          string
	AzureSubnet        string
	AzureNSG           string
	AzureSSHCIDRs      []string
	GCPProject         string

	GCPZone string

	GCPImage string

	GCPNetwork string

	GCPSubnet string
	GCPTags   []string

	GCPSSHCIDRs []string
	GCPRootGB   int64

	GCPServiceAccount string
	SSHUser           string
	SSHKey            string
	SSHPort           string
	SSHFallbackPorts  []string
	ProviderKey       string
	WorkRoot          string
	TTL               time.Duration
	IdleTimeout       time.Duration
	Sync              SyncConfig
	EnvAllow          []string
	Capacity          CapacityConfig
	Actions           ActionsConfig
	Blacksmith        BlacksmithConfig
	Namespace         NamespaceConfig
	Daytona           DaytonaConfig
	E2B               E2BConfig
	Islo              IsloConfig
	Semaphore         SemaphoreConfig
	Sprites           SpritesConfig
	Tailscale         TailscaleConfig
	Static            StaticConfig
	Results           ResultsConfig
	Cache             CacheConfig
	Jobs              map[string]JobConfig
	// contains filtered or unexported fields
}

func BaseConfig added in v0.6.0

func BaseConfig() Config

type CoordinatorArtifactUploadGrant added in v0.8.0

type CoordinatorArtifactUploadGrant struct {
	Name   string `json:"name"`
	Key    string `json:"key"`
	Upload struct {
		Method    string            `json:"method"`
		URL       string            `json:"url"`
		Headers   map[string]string `json:"headers"`
		ExpiresAt string            `json:"expiresAt"`
	} `json:"upload"`
	URL string `json:"url"`
}

type CoordinatorArtifactUploadInput added in v0.8.0

type CoordinatorArtifactUploadInput struct {
	Name        string `json:"name"`
	Size        int64  `json:"size"`
	ContentType string `json:"contentType,omitempty"`
	SHA256      string `json:"sha256,omitempty"`
}

type CoordinatorArtifactUploadRequest added in v0.8.0

type CoordinatorArtifactUploadRequest struct {
	Prefix string                           `json:"prefix,omitempty"`
	Files  []CoordinatorArtifactUploadInput `json:"files"`
}

type CoordinatorArtifactUploadResponse added in v0.8.0

type CoordinatorArtifactUploadResponse struct {
	Backend   string                           `json:"backend"`
	Bucket    string                           `json:"bucket"`
	Prefix    string                           `json:"prefix"`
	ExpiresAt string                           `json:"expiresAt"`
	Files     []CoordinatorArtifactUploadGrant `json:"files"`
}

type CoordinatorClient

type CoordinatorClient struct {
	BaseURL string
	Token   string
	Access  AccessConfig
	Client  *http.Client
}

func (*CoordinatorClient) AdminDeleteLease

func (c *CoordinatorClient) AdminDeleteLease(ctx context.Context, id string) (CoordinatorLease, error)

func (*CoordinatorClient) AdminLeases

func (c *CoordinatorClient) AdminLeases(ctx context.Context, state, owner, org string, limit int) ([]CoordinatorLease, error)

func (*CoordinatorClient) AdminReleaseLease

func (c *CoordinatorClient) AdminReleaseLease(ctx context.Context, id string, deleteServer bool) (CoordinatorLease, error)

func (*CoordinatorClient) AppendRunEvent added in v0.3.0

func (*CoordinatorClient) AppendRunTelemetry added in v0.6.0

func (c *CoordinatorClient) AppendRunTelemetry(ctx context.Context, runID string, telemetry *LeaseTelemetry) (CoordinatorRun, error)

func (*CoordinatorClient) CreateArtifactUploads added in v0.8.0

func (*CoordinatorClient) CreateCodeTicket added in v0.6.0

func (c *CoordinatorClient) CreateCodeTicket(ctx context.Context, leaseID string) (coordinatorCodeTicket, error)

func (*CoordinatorClient) CreateEgressTicket added in v0.7.0

func (c *CoordinatorClient) CreateEgressTicket(ctx context.Context, leaseID, role, sessionID, profile string, allow []string) (CoordinatorEgressTicket, error)

func (*CoordinatorClient) CreateImage added in v0.3.0

func (c *CoordinatorClient) CreateImage(ctx context.Context, leaseID, name string, noReboot bool) (CoordinatorImage, error)

func (*CoordinatorClient) CreateLease

func (c *CoordinatorClient) CreateLease(ctx context.Context, cfg Config, publicKey string, keep bool, leaseID, slug string) (CoordinatorLease, error)

func (*CoordinatorClient) CreateRun

func (c *CoordinatorClient) CreateRun(ctx context.Context, leaseID string, cfg Config, command []string) (CoordinatorRun, error)

func (*CoordinatorClient) CreateWebVNCTicket added in v0.5.0

func (c *CoordinatorClient) CreateWebVNCTicket(ctx context.Context, leaseID string) (CoordinatorWebVNCTicket, error)

func (*CoordinatorClient) DeleteLeaseShare added in v0.7.0

func (c *CoordinatorClient) DeleteLeaseShare(ctx context.Context, id, user string, org bool) (CoordinatorShare, error)

func (*CoordinatorClient) EgressStatus added in v0.7.0

func (c *CoordinatorClient) EgressStatus(ctx context.Context, leaseID string) (CoordinatorEgressStatus, error)

func (*CoordinatorClient) FinishRun

func (c *CoordinatorClient) FinishRun(ctx context.Context, runID string, exitCode int, sync, command time.Duration, log string, truncated bool, results *TestResultSummary, telemetry *RunTelemetrySummary) (CoordinatorRun, error)

func (*CoordinatorClient) GetLease

func (*CoordinatorClient) Health

func (c *CoordinatorClient) Health(ctx context.Context) error

func (*CoordinatorClient) Image added in v0.3.0

func (c *CoordinatorClient) Image(ctx context.Context, imageID string) (CoordinatorImage, error)

func (*CoordinatorClient) LeaseShare added in v0.7.0

func (c *CoordinatorClient) LeaseShare(ctx context.Context, id string) (CoordinatorShare, error)

func (*CoordinatorClient) Leases added in v0.8.0

func (c *CoordinatorClient) Leases(ctx context.Context, state string, limit int) ([]CoordinatorLease, error)

func (*CoordinatorClient) PollGitHubLogin added in v0.2.0

func (c *CoordinatorClient) PollGitHubLogin(ctx context.Context, loginID, pollSecret string) (CoordinatorGitHubLoginPoll, error)

func (*CoordinatorClient) Pool

func (*CoordinatorClient) PromoteImage added in v0.3.0

func (c *CoordinatorClient) PromoteImage(ctx context.Context, imageID string) (CoordinatorImage, error)

func (*CoordinatorClient) ProviderReadiness added in v0.10.0

func (c *CoordinatorClient) ProviderReadiness(ctx context.Context, provider string) (CoordinatorProviderReadiness, error)

func (*CoordinatorClient) ReleaseLease

func (c *CoordinatorClient) ReleaseLease(ctx context.Context, id string, deleteServer bool) (CoordinatorLease, error)

func (*CoordinatorClient) ResetWebVNC added in v0.7.0

func (c *CoordinatorClient) ResetWebVNC(ctx context.Context, leaseID string) (CoordinatorWebVNCReset, error)

func (*CoordinatorClient) Run

func (*CoordinatorClient) RunEvents added in v0.3.0

func (c *CoordinatorClient) RunEvents(ctx context.Context, runID string, after, limit int) ([]CoordinatorRunEvent, error)

func (*CoordinatorClient) RunLogs

func (c *CoordinatorClient) RunLogs(ctx context.Context, runID string) (string, error)

func (*CoordinatorClient) Runs

func (c *CoordinatorClient) Runs(ctx context.Context, leaseID, owner, org, state string, limit int) ([]CoordinatorRun, error)

func (*CoordinatorClient) StartGitHubLogin added in v0.2.0

func (c *CoordinatorClient) StartGitHubLogin(ctx context.Context, pollSecretHash, provider string) (CoordinatorGitHubLoginStart, error)

func (*CoordinatorClient) SyncExternalRunners added in v0.6.0

func (*CoordinatorClient) TouchLease

func (c *CoordinatorClient) TouchLease(ctx context.Context, id string) (CoordinatorLease, error)

func (*CoordinatorClient) TouchLeaseWithTelemetry added in v0.6.0

func (c *CoordinatorClient) TouchLeaseWithTelemetry(ctx context.Context, id string, telemetry *LeaseTelemetry) (CoordinatorLease, error)

func (*CoordinatorClient) UpdateLeaseIdleTimeout

func (c *CoordinatorClient) UpdateLeaseIdleTimeout(ctx context.Context, id string, idleTimeout time.Duration) (CoordinatorLease, error)

func (*CoordinatorClient) UpdateLeaseIdleTimeoutWithTelemetry added in v0.6.0

func (c *CoordinatorClient) UpdateLeaseIdleTimeoutWithTelemetry(ctx context.Context, id string, idleTimeout time.Duration, telemetry *LeaseTelemetry) (CoordinatorLease, error)

func (*CoordinatorClient) UpdateLeaseShare added in v0.7.0

func (c *CoordinatorClient) UpdateLeaseShare(ctx context.Context, id string, share CoordinatorShare) (CoordinatorShare, error)

func (*CoordinatorClient) UpdateLeaseTailscale added in v0.5.0

func (c *CoordinatorClient) UpdateLeaseTailscale(ctx context.Context, id string, meta TailscaleMetadata) (CoordinatorLease, error)

func (*CoordinatorClient) Usage

func (c *CoordinatorClient) Usage(ctx context.Context, scope, owner, org, month string) (CoordinatorUsageResponse, error)

func (*CoordinatorClient) WebVNCStatus added in v0.7.0

func (c *CoordinatorClient) WebVNCStatus(ctx context.Context, leaseID string) (CoordinatorWebVNCStatus, error)

func (*CoordinatorClient) Whoami

type CoordinatorCostLimits

type CoordinatorCostLimits struct {
	MaxActiveLeases         int     `json:"maxActiveLeases"`
	MaxActiveLeasesPerOwner int     `json:"maxActiveLeasesPerOwner"`
	MaxActiveLeasesPerOrg   int     `json:"maxActiveLeasesPerOrg"`
	MaxMonthlyUSD           float64 `json:"maxMonthlyUSD"`
	MaxMonthlyUSDPerOwner   float64 `json:"maxMonthlyUSDPerOwner"`
	MaxMonthlyUSDPerOrg     float64 `json:"maxMonthlyUSDPerOrg"`
}

type CoordinatorEgressStatus added in v0.7.0

type CoordinatorEgressStatus struct {
	LeaseID         string   `json:"leaseID"`
	Slug            string   `json:"slug,omitempty"`
	SessionID       string   `json:"sessionID,omitempty"`
	Profile         string   `json:"profile,omitempty"`
	Allow           []string `json:"allow,omitempty"`
	HostConnected   bool     `json:"hostConnected"`
	ClientConnected bool     `json:"clientConnected"`
	CreatedAt       string   `json:"createdAt,omitempty"`
	UpdatedAt       string   `json:"updatedAt,omitempty"`
}

type CoordinatorEgressTicket added in v0.7.0

type CoordinatorEgressTicket struct {
	Ticket    string `json:"ticket"`
	LeaseID   string `json:"leaseID"`
	Role      string `json:"role"`
	SessionID string `json:"sessionID"`
	ExpiresAt string `json:"expiresAt"`
}

type CoordinatorExternalRunner added in v0.6.0

type CoordinatorExternalRunner struct {
	ID                   string `json:"id"`
	Provider             string `json:"provider,omitempty"`
	Status               string `json:"status,omitempty"`
	Repo                 string `json:"repo,omitempty"`
	Workflow             string `json:"workflow,omitempty"`
	Job                  string `json:"job,omitempty"`
	Ref                  string `json:"ref,omitempty"`
	CreatedAt            string `json:"createdAt,omitempty"`
	Created              string `json:"created,omitempty"`
	ActionsRepo          string `json:"actionsRepo,omitempty"`
	ActionsRunID         string `json:"actionsRunID,omitempty"`
	ActionsRunURL        string `json:"actionsRunURL,omitempty"`
	ActionsRunStatus     string `json:"actionsRunStatus,omitempty"`
	ActionsRunConclusion string `json:"actionsRunConclusion,omitempty"`
	ActionsWorkflowName  string `json:"actionsWorkflowName,omitempty"`
	ActionsWorkflowURL   string `json:"actionsWorkflowURL,omitempty"`
}

type CoordinatorExternalRunnerSyncResponse added in v0.6.0

type CoordinatorExternalRunnerSyncResponse struct {
	Runners []CoordinatorExternalRunner `json:"runners"`
	Stale   []CoordinatorExternalRunner `json:"stale"`
}

type CoordinatorGitHubLoginPoll added in v0.2.0

type CoordinatorGitHubLoginPoll struct {
	Status   string `json:"status"`
	Token    string `json:"token,omitempty"`
	Owner    string `json:"owner,omitempty"`
	Org      string `json:"org,omitempty"`
	Login    string `json:"login,omitempty"`
	Provider string `json:"provider,omitempty"`
	Error    string `json:"error,omitempty"`
}

type CoordinatorGitHubLoginStart added in v0.2.0

type CoordinatorGitHubLoginStart struct {
	LoginID   string `json:"loginID"`
	URL       string `json:"url"`
	ExpiresAt string `json:"expiresAt"`
}

type CoordinatorHTTPError added in v0.9.0

type CoordinatorHTTPError struct {
	Method     string
	Path       string
	StatusCode int
	Message    string
}

func (CoordinatorHTTPError) Error added in v0.9.0

func (e CoordinatorHTTPError) Error() string

type CoordinatorID

type CoordinatorID string

func (*CoordinatorID) UnmarshalJSON

func (id *CoordinatorID) UnmarshalJSON(data []byte) error

type CoordinatorImage added in v0.3.0

type CoordinatorImage struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	State      string `json:"state"`
	Region     string `json:"region,omitempty"`
	PromotedAt string `json:"promotedAt,omitempty"`
}

type CoordinatorLease

type CoordinatorLease struct {
	ID                   string                `json:"id"`
	Slug                 string                `json:"slug,omitempty"`
	Provider             string                `json:"provider"`
	TargetOS             string                `json:"target,omitempty"`
	WindowsMode          string                `json:"windowsMode,omitempty"`
	Desktop              bool                  `json:"desktop,omitempty"`
	Browser              bool                  `json:"browser,omitempty"`
	Code                 bool                  `json:"code,omitempty"`
	Tailscale            *TailscaleMetadata    `json:"tailscale,omitempty"`
	Region               string                `json:"region,omitempty"`
	Owner                string                `json:"owner"`
	Org                  string                `json:"org"`
	Share                *CoordinatorShare     `json:"share,omitempty"`
	Profile              string                `json:"profile"`
	Class                string                `json:"class"`
	ServerType           string                `json:"serverType"`
	RequestedServerType  string                `json:"requestedServerType,omitempty"`
	Market               string                `json:"market,omitempty"`
	ProvisioningAttempts []ProvisioningAttempt `json:"provisioningAttempts,omitempty"`
	CapacityHints        []CapacityHint        `json:"capacityHints,omitempty"`
	ServerID             int64                 `json:"serverID"`
	CloudID              string                `json:"cloudID"`
	ServerName           string                `json:"serverName"`
	Host                 string                `json:"host"`
	SSHUser              string                `json:"sshUser"`
	SSHPort              string                `json:"sshPort"`
	SSHFallbackPorts     []string              `json:"sshFallbackPorts,omitempty"`
	WorkRoot             string                `json:"workRoot"`
	Keep                 bool                  `json:"keep"`
	State                string                `json:"state"`
	TTLSeconds           int                   `json:"ttlSeconds,omitempty"`
	IdleTimeoutSeconds   int                   `json:"idleTimeoutSeconds,omitempty"`
	CreatedAt            string                `json:"createdAt,omitempty"`
	UpdatedAt            string                `json:"updatedAt,omitempty"`
	LastTouchedAt        string                `json:"lastTouchedAt,omitempty"`
	ExpiresAt            string                `json:"expiresAt"`
	Telemetry            *LeaseTelemetry       `json:"telemetry,omitempty"`
	TelemetryHistory     []*LeaseTelemetry     `json:"telemetryHistory,omitempty"`
}

type CoordinatorMachine

type CoordinatorMachine struct {
	ID         CoordinatorID     `json:"id"`
	Provider   string            `json:"provider"`
	CloudID    string            `json:"cloudID"`
	Name       string            `json:"name"`
	Status     string            `json:"status"`
	ServerType string            `json:"serverType"`
	Host       string            `json:"host"`
	Labels     map[string]string `json:"labels"`
}

type CoordinatorMode added in v0.6.0

type CoordinatorMode string
const (
	CoordinatorNever     CoordinatorMode = "never"
	CoordinatorSupported CoordinatorMode = "supported"
)

type CoordinatorProviderReadiness added in v0.10.0

type CoordinatorProviderReadiness struct {
	Provider   string   `json:"provider"`
	Configured bool     `json:"configured"`
	Missing    []string `json:"missing,omitempty"`
	Message    string   `json:"message,omitempty"`
}

type CoordinatorRun

type CoordinatorRun struct {
	ID           string               `json:"id"`
	LeaseID      string               `json:"leaseID"`
	Slug         string               `json:"slug,omitempty"`
	Owner        string               `json:"owner"`
	Org          string               `json:"org"`
	Provider     string               `json:"provider"`
	TargetOS     string               `json:"target,omitempty"`
	WindowsMode  string               `json:"windowsMode,omitempty"`
	Class        string               `json:"class"`
	ServerType   string               `json:"serverType"`
	Command      []string             `json:"command"`
	State        string               `json:"state"`
	Phase        string               `json:"phase,omitempty"`
	ExitCode     *int                 `json:"exitCode,omitempty"`
	SyncMs       int64                `json:"syncMs,omitempty"`
	CommandMs    int64                `json:"commandMs,omitempty"`
	DurationMs   int64                `json:"durationMs,omitempty"`
	LogBytes     int64                `json:"logBytes"`
	LogTruncated bool                 `json:"logTruncated"`
	Results      *TestResultSummary   `json:"results,omitempty"`
	Telemetry    *RunTelemetrySummary `json:"telemetry,omitempty"`
	StartedAt    string               `json:"startedAt"`
	LastEventAt  string               `json:"lastEventAt,omitempty"`
	EventCount   int                  `json:"eventCount,omitempty"`
	EndedAt      string               `json:"endedAt,omitempty"`
}

type CoordinatorRunEvent added in v0.3.0

type CoordinatorRunEvent struct {
	RunID       string `json:"runID"`
	Seq         int    `json:"seq"`
	Type        string `json:"type"`
	Phase       string `json:"phase,omitempty"`
	Stream      string `json:"stream,omitempty"`
	Message     string `json:"message,omitempty"`
	Data        string `json:"data,omitempty"`
	LeaseID     string `json:"leaseID,omitempty"`
	Slug        string `json:"slug,omitempty"`
	Provider    string `json:"provider,omitempty"`
	TargetOS    string `json:"target,omitempty"`
	WindowsMode string `json:"windowsMode,omitempty"`
	Class       string `json:"class,omitempty"`
	ServerType  string `json:"serverType,omitempty"`
	ExitCode    *int   `json:"exitCode,omitempty"`
	CreatedAt   string `json:"createdAt"`
}

type CoordinatorRunEventInput added in v0.3.0

type CoordinatorRunEventInput struct {
	Type        string `json:"type,omitempty"`
	Phase       string `json:"phase,omitempty"`
	Stream      string `json:"stream,omitempty"`
	Message     string `json:"message,omitempty"`
	Data        string `json:"data,omitempty"`
	LeaseID     string `json:"leaseID,omitempty"`
	Slug        string `json:"slug,omitempty"`
	Provider    string `json:"provider,omitempty"`
	TargetOS    string `json:"target,omitempty"`
	WindowsMode string `json:"windowsMode,omitempty"`
	Class       string `json:"class,omitempty"`
	ServerType  string `json:"serverType,omitempty"`
	ExitCode    *int   `json:"exitCode,omitempty"`
}

type CoordinatorRunEventResponse added in v0.3.0

type CoordinatorRunEventResponse struct {
	Event CoordinatorRunEvent `json:"event"`
}

type CoordinatorRunEventsResponse added in v0.3.0

type CoordinatorRunEventsResponse struct {
	Events []CoordinatorRunEvent `json:"events"`
}

type CoordinatorRunResponse

type CoordinatorRunResponse struct {
	Run CoordinatorRun `json:"run"`
}

type CoordinatorRunsResponse

type CoordinatorRunsResponse struct {
	Runs []CoordinatorRun `json:"runs"`
}

type CoordinatorShare added in v0.7.0

type CoordinatorShare struct {
	Users     map[string]CoordinatorShareRole `json:"users,omitempty"`
	Org       CoordinatorShareRole            `json:"org,omitempty"`
	UpdatedAt string                          `json:"updatedAt,omitempty"`
	UpdatedBy string                          `json:"updatedBy,omitempty"`
}

type CoordinatorShareRole added in v0.7.0

type CoordinatorShareRole string
const (
	CoordinatorShareUse    CoordinatorShareRole = "use"
	CoordinatorShareManage CoordinatorShareRole = "manage"
)

type CoordinatorUsageGroup

type CoordinatorUsageGroup struct {
	Key            string  `json:"key"`
	Leases         int     `json:"leases"`
	ActiveLeases   int     `json:"activeLeases"`
	RuntimeSeconds int64   `json:"runtimeSeconds"`
	EstimatedUSD   float64 `json:"estimatedUSD"`
	ReservedUSD    float64 `json:"reservedUSD"`
}

type CoordinatorUsageResponse

type CoordinatorUsageResponse struct {
	Usage  CoordinatorUsageSummary `json:"usage"`
	Limits CoordinatorCostLimits   `json:"limits"`
}

type CoordinatorUsageSummary

type CoordinatorUsageSummary struct {
	Month          string                  `json:"month"`
	Scope          string                  `json:"scope"`
	Owner          string                  `json:"owner,omitempty"`
	Org            string                  `json:"org,omitempty"`
	Leases         int                     `json:"leases"`
	ActiveLeases   int                     `json:"activeLeases"`
	RuntimeSeconds int64                   `json:"runtimeSeconds"`
	EstimatedUSD   float64                 `json:"estimatedUSD"`
	ReservedUSD    float64                 `json:"reservedUSD"`
	ByOwner        []CoordinatorUsageGroup `json:"byOwner"`
	ByOrg          []CoordinatorUsageGroup `json:"byOrg"`
	ByProvider     []CoordinatorUsageGroup `json:"byProvider"`
	ByServerType   []CoordinatorUsageGroup `json:"byServerType"`
}

type CoordinatorWebVNCEvent added in v0.7.0

type CoordinatorWebVNCEvent struct {
	At     string `json:"at"`
	Event  string `json:"event"`
	Reason string `json:"reason,omitempty"`
}

type CoordinatorWebVNCReset added in v0.7.0

type CoordinatorWebVNCReset struct {
	LeaseID            string                   `json:"leaseID"`
	Slug               string                   `json:"slug,omitempty"`
	BridgeWasConnected bool                     `json:"bridgeWasConnected"`
	ViewerWasConnected bool                     `json:"viewerWasConnected"`
	Command            string                   `json:"command"`
	Events             []CoordinatorWebVNCEvent `json:"events,omitempty"`
}

type CoordinatorWebVNCStatus added in v0.7.0

type CoordinatorWebVNCStatus struct {
	LeaseID              string                   `json:"leaseID"`
	Slug                 string                   `json:"slug,omitempty"`
	BridgeConnected      bool                     `json:"bridgeConnected"`
	ViewerConnected      bool                     `json:"viewerConnected"`
	ViewerCount          int                      `json:"viewerCount,omitempty"`
	ObserverCount        int                      `json:"observerCount,omitempty"`
	AvailableViewerSlots int                      `json:"availableViewerSlots,omitempty"`
	ControllerLabel      string                   `json:"controllerLabel,omitempty"`
	Command              string                   `json:"command"`
	Message              string                   `json:"message,omitempty"`
	Events               []CoordinatorWebVNCEvent `json:"events,omitempty"`
}

type CoordinatorWebVNCTicket added in v0.5.0

type CoordinatorWebVNCTicket struct {
	Ticket    string `json:"ticket"`
	LeaseID   string `json:"leaseID"`
	ExpiresAt string `json:"expiresAt"`
}

type CoordinatorWhoami

type CoordinatorWhoami struct {
	Owner string `json:"owner"`
	Org   string `json:"org"`
	Auth  string `json:"auth"`
}

type DaytonaConfig added in v0.6.0

type DaytonaConfig struct {
	APIKey           string
	JWTToken         string
	OrganizationID   string
	APIURL           string
	Snapshot         string
	Target           string
	User             string
	WorkRoot         string
	SSHGatewayHost   string
	SSHAccessMinutes int
}

type DelegatedRunBackend added in v0.6.0

type DelegatedRunBackend interface {
	Backend
	Warmup(ctx context.Context, req WarmupRequest) error
	Run(ctx context.Context, req RunRequest) (RunResult, error)
	List(ctx context.Context, req ListRequest) ([]LeaseView, error)
	Status(ctx context.Context, req StatusRequest) (StatusView, error)
	Stop(ctx context.Context, req StopRequest) error
}

type E2BConfig added in v0.8.0

type E2BConfig struct {
	APIKey   string
	APIURL   string
	Domain   string
	Template string
	Workdir  string
	User     string
}

type ExitError

type ExitError struct {
	Code    int
	Message string
}

func Exit added in v0.6.0

func Exit(code int, format string, args ...any) ExitError

func (ExitError) Error

func (e ExitError) Error() string

type Feature added in v0.6.0

type Feature string
const (
	FeatureSSH         Feature = "ssh"
	FeatureCrabboxSync Feature = "crabbox-sync"
	FeatureCleanup     Feature = "cleanup"
	FeatureDesktop     Feature = "desktop"
	FeatureBrowser     Feature = "browser"
	FeatureCode        Feature = "code"
	FeatureTailscale   Feature = "tailscale"
)

type FeatureSet added in v0.6.0

type FeatureSet []Feature

type GCPClient added in v0.11.0

type GCPClient struct {
	Project        string
	Zone           string
	Zones          []string
	Image          string
	Network        string
	Subnet         string
	Tags           []string
	SSHCIDRs       []string
	RootGB         int64
	ServiceAccount string
	SSHPort        string
	FallbackPorts  []string
	// contains filtered or unexported fields
}

func NewGCPClient added in v0.11.0

func NewGCPClient(ctx context.Context, cfg Config) (*GCPClient, error)

func (*GCPClient) CreateServerWithFallback added in v0.11.0

func (c *GCPClient) CreateServerWithFallback(ctx context.Context, cfg Config, publicKey, leaseID, slug string, keep bool, logf func(string, ...any)) (Server, Config, error)

func (*GCPClient) DeleteServer added in v0.11.0

func (c *GCPClient) DeleteServer(ctx context.Context, name string) error

func (*GCPClient) EnsureFirewall added in v0.11.0

func (c *GCPClient) EnsureFirewall(ctx context.Context) error

func (*GCPClient) GetServer added in v0.11.0

func (c *GCPClient) GetServer(ctx context.Context, name string) (Server, error)

func (*GCPClient) ListCrabboxServers added in v0.11.0

func (c *GCPClient) ListCrabboxServers(ctx context.Context) ([]Server, error)

func (*GCPClient) SetLabels added in v0.11.0

func (c *GCPClient) SetLabels(ctx context.Context, name string, labels map[string]string) error

func (*GCPClient) WaitForServerIP added in v0.11.0

func (c *GCPClient) WaitForServerIP(ctx context.Context, name string) (Server, error)

type GitHubRepo

type GitHubRepo struct {
	Owner string
	Name  string
}

func (GitHubRepo) Slug

func (r GitHubRepo) Slug() string

type HetznerClient

type HetznerClient struct {
	Token  string
	Client *http.Client
}

func NewHetznerClient added in v0.6.0

func NewHetznerClient() (*HetznerClient, error)

func (*HetznerClient) CreateServer

func (c *HetznerClient) CreateServer(ctx context.Context, cfg Config, publicKey, leaseID, slug string, keep bool) (Server, error)

func (*HetznerClient) CreateServerWithFallback

func (c *HetznerClient) CreateServerWithFallback(ctx context.Context, cfg Config, publicKey, leaseID, slug string, keep bool, logf func(string, ...any)) (Server, Config, error)

func (*HetznerClient) DeleteSSHKey

func (c *HetznerClient) DeleteSSHKey(ctx context.Context, name string) error

func (*HetznerClient) DeleteServer

func (c *HetznerClient) DeleteServer(ctx context.Context, id int64) error

func (*HetznerClient) EnsureSSHKey

func (c *HetznerClient) EnsureSSHKey(ctx context.Context, name, publicKey string) (SSHKey, error)

func (*HetznerClient) GetServer

func (c *HetznerClient) GetServer(ctx context.Context, id int64) (Server, error)

func (*HetznerClient) ListCrabboxServers

func (c *HetznerClient) ListCrabboxServers(ctx context.Context) ([]Server, error)

func (*HetznerClient) SetLabels

func (c *HetznerClient) SetLabels(ctx context.Context, id int64, labels map[string]string) error

type IsloConfig added in v0.6.0

type IsloConfig struct {
	APIKey         string
	BaseURL        string
	Image          string
	Workdir        string
	GatewayProfile string
	SnapshotName   string
	VCPUs          int
	MemoryMB       int
	DiskGB         int
}

type JSONListBackend added in v0.6.0

type JSONListBackend interface {
	Backend
	ListJSON(ctx context.Context, req ListRequest) (any, error)
}

type JobActionsConfig added in v0.11.0

type JobActionsConfig struct {
	Repo     string
	Workflow string
	Job      string
	Ref      string
	Fields   []string
}

type JobConfig added in v0.11.0

type JobConfig struct {
	Provider       string
	Target         string
	WindowsMode    string
	Profile        string
	Class          string
	ServerType     string
	Market         string
	TTL            time.Duration
	IdleTimeout    time.Duration
	Desktop        *bool
	Browser        *bool
	Code           *bool
	Network        string
	Hydrate        JobHydrateConfig
	Actions        JobActionsConfig
	Shell          bool
	Command        string
	NoSync         bool
	SyncOnly       bool
	Checksum       *bool
	ForceSyncLarge bool
	JUnit          []string
	Downloads      []string
	Stop           string
}

type JobHydrateConfig added in v0.11.0

type JobHydrateConfig struct {
	Actions          bool
	WaitTimeout      time.Duration
	KeepAliveMinutes int
}

type LeaseClaim added in v0.6.0

type LeaseClaim = leaseClaim

func ReadLeaseClaim added in v0.6.0

func ReadLeaseClaim(leaseID string) (LeaseClaim, error)

func ResolveLeaseClaim added in v0.6.0

func ResolveLeaseClaim(identifier string) (LeaseClaim, bool, error)

type LeaseOptions added in v0.6.0

type LeaseOptions struct {
	TargetOS      string
	WindowsMode   string
	Class         string
	ServerType    string
	IdleTimeout   time.Duration
	TTL           time.Duration
	Desktop       bool
	Browser       bool
	Code          bool
	Tailscale     TailscaleConfig
	WorkRoot      string
	SSHUser       string
	SSHPort       string
	SSHKey        string
	Sync          SyncConfig
	Results       ResultsConfig
	EnvAllow      []string
	ActionsRunner bool
}

type LeaseTarget added in v0.6.0

type LeaseTarget struct {
	Server      Server
	SSH         SSHTarget
	LeaseID     string
	Coordinator *CoordinatorClient
}

type LeaseTelemetry added in v0.6.0

type LeaseTelemetry struct {
	CapturedAt       string   `json:"capturedAt,omitempty"`
	Source           string   `json:"source,omitempty"`
	Load1            *float64 `json:"load1,omitempty"`
	Load5            *float64 `json:"load5,omitempty"`
	Load15           *float64 `json:"load15,omitempty"`
	MemoryUsedBytes  *int64   `json:"memoryUsedBytes,omitempty"`
	MemoryTotalBytes *int64   `json:"memoryTotalBytes,omitempty"`
	MemoryPercent    *float64 `json:"memoryPercent,omitempty"`
	DiskUsedBytes    *int64   `json:"diskUsedBytes,omitempty"`
	DiskTotalBytes   *int64   `json:"diskTotalBytes,omitempty"`
	DiskPercent      *float64 `json:"diskPercent,omitempty"`
	UptimeSeconds    *int64   `json:"uptimeSeconds,omitempty"`
}

type LeaseView added in v0.6.0

type LeaseView = Server

type ListRequest added in v0.6.0

type ListRequest struct {
	Options LeaseOptions
	All     bool
}

type LocalCommandRequest added in v0.6.0

type LocalCommandRequest struct {
	Name   string
	Args   []string
	Env    []string
	Dir    string
	Stdout io.Writer
	Stderr io.Writer
}

type LocalCommandResult added in v0.6.0

type LocalCommandResult struct {
	ExitCode int
	Stdout   string
	Stderr   string
}

type NamespaceConfig added in v0.9.0

type NamespaceConfig struct {
	Image               string
	Size                string
	Repository          string
	Site                string
	VolumeSizeGB        int
	AutoStopIdleTimeout time.Duration
	WorkRoot            string
	DeleteOnRelease     bool
}

type NetworkMode added in v0.5.0

type NetworkMode string
const (
	NetworkAuto      NetworkMode = "auto"
	NetworkTailscale NetworkMode = "tailscale"
	NetworkPublic    NetworkMode = "public"
)

type Provider added in v0.6.0

type Provider interface {
	Name() string
	Aliases() []string
	Spec() ProviderSpec
	RegisterFlags(fs *flag.FlagSet, defaults Config) any
	ApplyFlags(cfg *Config, fs *flag.FlagSet, values any) error
	Configure(cfg Config, rt Runtime) (Backend, error)
}

func ProviderFor added in v0.6.0

func ProviderFor(name string) (Provider, error)

type ProviderKind added in v0.6.0

type ProviderKind string
const (
	ProviderKindSSHLease     ProviderKind = "ssh-lease"
	ProviderKindDelegatedRun ProviderKind = "delegated-run"
)

type ProviderSpec added in v0.6.0

type ProviderSpec struct {
	Name        string
	Kind        ProviderKind
	Targets     []TargetSpec
	Features    FeatureSet
	Coordinator CoordinatorMode
}

type ProvisioningAttempt added in v0.3.0

type ProvisioningAttempt struct {
	Region     string `json:"region,omitempty"`
	ServerType string `json:"serverType"`
	Market     string `json:"market,omitempty"`
	Category   string `json:"category,omitempty"`
	Message    string `json:"message"`
}

type ReleaseLeaseRequest added in v0.6.0

type ReleaseLeaseRequest struct {
	Lease LeaseTarget
	Force bool
}

type Repo

type Repo struct {
	Root      string
	Name      string
	RemoteURL string
	Head      string
	BaseRef   string
}

type ResolveRequest added in v0.6.0

type ResolveRequest struct {
	Repo        Repo
	Options     LeaseOptions
	ID          string
	Reclaim     bool
	ReleaseOnly bool
}

type ResultsConfig

type ResultsConfig struct {
	JUnit []string
}

type RunRequest added in v0.6.0

type RunRequest struct {
	Repo           Repo
	ID             string
	Options        LeaseOptions
	Keep           bool
	Reclaim        bool
	NoSync         bool
	SyncOnly       bool
	DebugSync      bool
	ShellMode      bool
	ChecksumSync   bool
	ForceSyncLarge bool
	CaptureStdout  string
	Downloads      []string
	Command        []string
	TimingJSON     bool
}

type RunResult added in v0.6.0

type RunResult struct {
	ExitCode      int
	Command       time.Duration
	Total         time.Duration
	SyncDelegated bool
}

type RunTelemetrySummary added in v0.6.0

type RunTelemetrySummary struct {
	Start   *LeaseTelemetry   `json:"start,omitempty"`
	End     *LeaseTelemetry   `json:"end,omitempty"`
	Samples []*LeaseTelemetry `json:"samples,omitempty"`
}

type Runtime added in v0.6.0

type Runtime struct {
	Stdout io.Writer
	Stderr io.Writer
	Clock  Clock
	HTTP   *http.Client
	Exec   CommandRunner
}

type SSHKey

type SSHKey struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
	PublicKey   string `json:"public_key"`
}

type SSHLeaseBackend added in v0.6.0

type SSHLeaseBackend interface {
	Backend
	Acquire(ctx context.Context, req AcquireRequest) (LeaseTarget, error)
	Resolve(ctx context.Context, req ResolveRequest) (LeaseTarget, error)
	List(ctx context.Context, req ListRequest) ([]LeaseView, error)
	ReleaseLease(ctx context.Context, req ReleaseLeaseRequest) error
	Touch(ctx context.Context, req TouchRequest) (Server, error)
}

type SSHTarget

type SSHTarget struct {
	User           string
	Host           string
	Key            string
	Port           string
	FallbackPorts  []string
	TargetOS       string
	WindowsMode    string
	ReadyCheck     string
	AuthSecret     bool
	NetworkKind    NetworkMode
	SSHConfigProxy bool
	ProxyCommand   string
}

func SSHTargetFromConfig added in v0.6.0

func SSHTargetFromConfig(cfg Config, host string) SSHTarget

type SemaphoreConfig added in v0.8.0

type SemaphoreConfig struct {
	Host        string
	Token       string
	Project     string
	Machine     string
	OSImage     string
	IdleTimeout string
}

type Server

type Server struct {
	CloudID   string
	Provider  string
	ID        int64             `json:"id"`
	Name      string            `json:"name"`
	Status    string            `json:"status"`
	Labels    map[string]string `json:"labels"`
	PublicNet struct {
		IPv4 struct {
			IP string `json:"ip"`
		} `json:"ipv4"`
	} `json:"public_net"`
	ServerType struct {
		Name string `json:"name"`
	} `json:"server_type"`
}

func FindServerByAlias added in v0.6.0

func FindServerByAlias(servers []Server, id string) (Server, string, error)

func TouchDirectLeaseBestEffort added in v0.6.0

func TouchDirectLeaseBestEffort(ctx context.Context, cfg Config, server Server, state string, stderr io.Writer) Server

func WaitForServerIP added in v0.6.0

func WaitForServerIP(ctx context.Context, client *HetznerClient, id int64) (Server, error)

func (Server) DisplayID

func (s Server) DisplayID() string

type SpritesConfig added in v0.9.0

type SpritesConfig struct {
	Token    string
	APIURL   string
	WorkRoot string
}

type StaticConfig added in v0.4.0

type StaticConfig struct {
	ID       string
	Name     string
	Host     string
	User     string
	Port     string
	WorkRoot string
}

type StatusRequest added in v0.6.0

type StatusRequest struct {
	Options     LeaseOptions
	ID          string
	Wait        bool
	WaitTimeout time.Duration
}

type StatusView added in v0.6.0

type StatusView struct {
	ID               string             `json:"id"`
	Slug             string             `json:"slug,omitempty"`
	Provider         string             `json:"provider"`
	TargetOS         string             `json:"target"`
	WindowsMode      string             `json:"windowsMode,omitempty"`
	State            string             `json:"state"`
	ServerID         string             `json:"serverId"`
	ServerType       string             `json:"serverType"`
	Host             string             `json:"host"`
	Network          NetworkMode        `json:"network"`
	Tailscale        *TailscaleMetadata `json:"tailscale,omitempty"`
	SSHHost          string             `json:"sshHost"`
	SSHUser          string             `json:"sshUser"`
	SSHPort          string             `json:"sshPort"`
	SSHFallbackPorts []string           `json:"sshFallbackPorts,omitempty"`
	SSHKey           string             `json:"sshKey"`
	LastTouchedAt    string             `json:"lastTouchedAt,omitempty"`
	IdleFor          string             `json:"idleFor,omitempty"`
	IdleTimeout      string             `json:"idleTimeout,omitempty"`
	ExpiresAt        string             `json:"expiresAt,omitempty"`
	Labels           map[string]string  `json:"labels,omitempty"`
	HasHost          bool               `json:"hasHost"`
	Ready            bool               `json:"ready"`
	Telemetry        *LeaseTelemetry    `json:"telemetry,omitempty"`
	TelemetryHistory []*LeaseTelemetry  `json:"telemetryHistory,omitempty"`
}

type StopRequest added in v0.6.0

type StopRequest struct {
	Options LeaseOptions
	ID      string
}

type SyncConfig

type SyncConfig struct {
	Excludes    []string
	Delete      bool
	Checksum    bool
	GitSeed     bool
	Fingerprint bool
	BaseRef     string
	Timeout     time.Duration
	WarnFiles   int
	WarnBytes   int64
	FailFiles   int
	FailBytes   int64
	AllowLarge  bool
}

type SyncManifest

type SyncManifest struct {
	Files   []string
	Deleted []string
	Bytes   int64
}

func BuildSyncManifest added in v0.6.0

func BuildSyncManifest(root string, excludes []string) (SyncManifest, error)

func (SyncManifest) DeletedNUL

func (m SyncManifest) DeletedNUL() []byte

func (SyncManifest) NUL

func (m SyncManifest) NUL() []byte

type TailscaleConfig added in v0.5.0

type TailscaleConfig struct {
	Enabled                bool
	Tags                   []string
	HostnameTemplate       string
	Hostname               string
	AuthKeyEnv             string
	AuthKey                string
	ExitNode               string
	ExitNodeAllowLANAccess bool
}

type TailscaleMetadata added in v0.5.0

type TailscaleMetadata struct {
	Enabled                bool     `json:"enabled"`
	Hostname               string   `json:"hostname,omitempty"`
	FQDN                   string   `json:"fqdn,omitempty"`
	IPv4                   string   `json:"ipv4,omitempty"`
	Tags                   []string `json:"tags,omitempty"`
	State                  string   `json:"state,omitempty"`
	Error                  string   `json:"error,omitempty"`
	ExitNode               string   `json:"exitNode,omitempty"`
	ExitNodeAllowLANAccess bool     `json:"exitNodeAllowLanAccess,omitempty"`
}

type TargetSpec added in v0.6.0

type TargetSpec struct {
	OS          string
	WindowsMode string
}

type TestFailure

type TestFailure struct {
	Suite     string `json:"suite"`
	Name      string `json:"name"`
	Classname string `json:"classname,omitempty"`
	File      string `json:"file,omitempty"`
	Message   string `json:"message,omitempty"`
	Type      string `json:"type,omitempty"`
	Kind      string `json:"kind"`
}

type TestResultSummary

type TestResultSummary struct {
	Format      string        `json:"format"`
	Files       []string      `json:"files"`
	Suites      int           `json:"suites"`
	Tests       int           `json:"tests"`
	Failures    int           `json:"failures"`
	Errors      int           `json:"errors"`
	Skipped     int           `json:"skipped"`
	TimeSeconds float64       `json:"timeSeconds"`
	Failed      []TestFailure `json:"failed"`
}

type TimingPhase added in v0.6.0

type TimingPhase struct {
	Name    string `json:"name"`
	Ms      int64  `json:"ms,omitempty"`
	Skipped bool   `json:"skipped,omitempty"`
	Reason  string `json:"reason,omitempty"`
}

type TimingReport added in v0.6.0

type TimingReport struct {
	Provider      string        `json:"provider"`
	LeaseID       string        `json:"leaseId,omitempty"`
	Slug          string        `json:"slug,omitempty"`
	SyncMs        int64         `json:"syncMs"`
	SyncPhases    []TimingPhase `json:"syncPhases,omitempty"`
	SyncSkipped   bool          `json:"syncSkipped"`
	SyncDelegated bool          `json:"syncDelegated,omitempty"`
	CommandMs     int64         `json:"commandMs"`
	TotalMs       int64         `json:"totalMs"`
	ExitCode      int           `json:"exitCode"`
	ActionsRunURL string        `json:"actionsRunUrl,omitempty"`
}

type TouchRequest added in v0.6.0

type TouchRequest struct {
	Lease       LeaseTarget
	State       string
	IdleTimeout time.Duration
}

type WarmupRequest added in v0.6.0

type WarmupRequest struct {
	Repo          Repo
	Options       LeaseOptions
	Keep          bool
	Reclaim       bool
	ActionsRunner bool
	TimingJSON    bool
}

Jump to

Keyboard shortcuts

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