Documentation
¶
Index ¶
- Constants
- type BuildReason
- type BuildStatus
- type BuildStatusGroup
- type DBTX
- type JSONBStringMap
- type PausedSandboxConfig
- type SandboxAutoResumeConfig
- type SandboxAutoResumePolicy
- type SandboxIam
- type SandboxIamToken
- type SandboxNetworkConfig
- type SandboxNetworkEgressConfig
- type SandboxNetworkIngressConfig
- type SandboxNetworkRule
- type SandboxNetworkTransform
- type SandboxVolumeMountConfig
Constants ¶
const AllowPublicAccessDefault = true
const PausedSandboxConfigVersion = "v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildReason ¶
type BuildStatus ¶
type BuildStatus string
BuildStatus represents the raw status value written to the env_builds table. Use BuildStatusGroup for read-side comparisons.
const ( BuildStatusPending BuildStatus = "pending" BuildStatusWaiting BuildStatus = "waiting" BuildStatusBuilding BuildStatus = "building" BuildStatusSnapshotting BuildStatus = "snapshotting" BuildStatusUploaded BuildStatus = "uploaded" BuildStatusSuccess BuildStatus = "success" BuildStatusFailed BuildStatus = "failed" )
type BuildStatusGroup ¶
type BuildStatusGroup string
BuildStatusGroup represents the normalized status from the status_group computed column. Use this type for all read-side comparisons.
const ( BuildStatusGroupPending BuildStatusGroup = "pending" BuildStatusGroupInProgress BuildStatusGroup = "in_progress" BuildStatusGroupReady BuildStatusGroup = "ready" BuildStatusGroupFailed BuildStatusGroup = "failed" )
func (BuildStatusGroup) IsTerminal ¶
func (g BuildStatusGroup) IsTerminal() bool
type DBTX ¶
type DBTX interface {
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}
DBTX is the interface that sqlc expects for database operations.
type JSONBStringMap ¶
func (JSONBStringMap) MarshalJSON ¶
func (m JSONBStringMap) MarshalJSON() ([]byte, error)
MarshalJSON ensures a nil map serializes as "{}" instead of "null", preventing SQL NULL when pgx encodes the value for jsonb columns.
func (*JSONBStringMap) UnmarshalJSON ¶
func (m *JSONBStringMap) UnmarshalJSON(data []byte) error
UnmarshalJSON ensures JSON null deserializes as an empty map instead of nil.
type PausedSandboxConfig ¶
type PausedSandboxConfig struct {
Version string `json:"version"`
Network *SandboxNetworkConfig `json:"network,omitempty"`
AutoResume *SandboxAutoResumeConfig `json:"autoResume,omitempty"`
VolumeMounts []*SandboxVolumeMountConfig `json:"volumeMounts,omitempty"`
// FilesystemOnly marks a snapshot that persists only the rootfs (no memory
// snapshot); resuming it cold-boots from disk. The orchestrator decides
// reboot-vs-resume from the snapshot's own metadata.json; this flag lets the
// API gate implicit-resume paths (auto-resume, /connect) without a round-trip.
// Pre-existing rows omit the key and decode to false (a memory snapshot).
FilesystemOnly bool `json:"filesystemOnly,omitempty"`
// AutoPauseFilesystemOnly is the sandbox's policy for the *next* auto-pause:
// when true, an auto-pause on timeout takes a filesystem-only snapshot rather
// than a full memory one. It is restored on resume so the policy survives a
// pause/resume cycle. Distinct from FilesystemOnly, which records the kind of
// *this* snapshot. Pre-existing rows omit the key and decode to false.
AutoPauseFilesystemOnly bool `json:"autoPauseFilesystemOnly,omitempty"`
// Iam preserves the sandbox workload identity configuration across
// pause/resume. A resumed sandbox gets a freshly generated execution ID, so
// any workload identity is rederived from the current execution rather than a
// stored subject. Pre-existing rows omit the key and decode to nil.
Iam *SandboxIam `json:"iam,omitempty"`
}
type SandboxAutoResumeConfig ¶
type SandboxAutoResumeConfig struct {
Policy SandboxAutoResumePolicy `json:"policy"`
Timeout uint64 `json:"timeout,omitempty"`
}
type SandboxAutoResumePolicy ¶
type SandboxAutoResumePolicy string
const ( SandboxAutoResumeAny SandboxAutoResumePolicy = "any" SandboxAutoResumeOff SandboxAutoResumePolicy = "off" )
type SandboxIam ¶
type SandboxIam struct {
// Tokens holds the named workload-token definitions, keyed by token name.
Tokens map[string]SandboxIamToken `json:"tokens,omitempty"`
}
SandboxIam is the sandbox workload identity configuration carried with the sandbox. A nil value means workload identity is disabled.
type SandboxIamToken ¶
type SandboxIamToken struct {
Audience string `json:"audience"`
TokenType string `json:"tokenType"`
}
SandboxIamToken is a named workload-token definition. filePath is intentionally not stored: only absent/null is accepted at admission, so there is nothing to persist.
type SandboxNetworkConfig ¶
type SandboxNetworkConfig struct {
Egress *SandboxNetworkEgressConfig `json:"egress,omitempty"`
Ingress *SandboxNetworkIngressConfig `json:"ingress,omitempty"`
}
func (*SandboxNetworkConfig) HasEgressProxy ¶
func (c *SandboxNetworkConfig) HasEgressProxy() bool
HasEgressProxy reports whether a customer-supplied SOCKS5 egress proxy is configured. The address is the single source of truth: credentials are optional and are never set without it.
func (*SandboxNetworkConfig) HasEgressProxyAuth ¶
func (c *SandboxNetworkConfig) HasEgressProxyAuth() bool
HasEgressProxyAuth reports whether the egress proxy is configured with RFC 1929 credentials.
type SandboxNetworkEgressConfig ¶
type SandboxNetworkEgressConfig struct {
AllowedAddresses []string `json:"allowedAddresses,omitempty"`
DeniedAddresses []string `json:"deniedAddresses,omitempty"`
Rules map[string][]SandboxNetworkRule `json:"rules,omitempty"`
// SOCKS5 BYOP egress proxy configuration.
EgressProxyAddress string `json:"egressProxyAddress,omitempty"`
EgressProxyUsername string `json:"egressProxyUsername,omitempty"`
EgressProxyPassword string `json:"egressProxyPassword,omitempty"`
}
type SandboxNetworkRule ¶
type SandboxNetworkRule struct {
Transform *SandboxNetworkTransform `json:"transform,omitempty"`
}