Documentation
¶
Index ¶
- func AgentHomeStateRoot(origin, contextName, workspaceID string) (string, error)
- func CanonicalStateRoot(origin, contextName, workspaceID string) (string, error)
- func DiagnosticsReaderIdentity() machinediagnostics.ReaderIdentity
- func GetEncodedWorkspaceDaemonConfig(platformOptions devsy.PlatformOptions, workspaceConfig *provider2.Workspace, ...) (string, error)
- func InstallDaemon(opts InstallOptions) error
- func RemoveDaemon() error
- func RunProcessReaper(ctx context.Context)
- type DaemonConfig
- type InstallOptions
- type ResolveStateLocationOptions
- type SshConfig
- type StateLayout
- type StateLocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentHomeStateRoot ¶
AgentHomeStateRoot derives the agent home from a workspace origin created by a container-side agent invocation.
func CanonicalStateRoot ¶
CanonicalStateRoot derives the canonical data root from a persisted workspace origin while validating every structural component.
func DiagnosticsReaderIdentity ¶
func DiagnosticsReaderIdentity() machinediagnostics.ReaderIdentity
DiagnosticsReaderIdentity captures the invoking user before systemd starts the daemon as root. SUDO_UID/GID identify the original user on sudo paths.
func GetEncodedWorkspaceDaemonConfig ¶
func GetEncodedWorkspaceDaemonConfig( platformOptions devsy.PlatformOptions, workspaceConfig *provider2.Workspace, substitutionContext *config.SubstitutionContext, mergedConfig *config.MergedDevContainerConfig, ) (string, error)
func InstallDaemon ¶
func InstallDaemon( opts InstallOptions, ) error
func RemoveDaemon ¶
func RemoveDaemon() error
func RunProcessReaper ¶
RunProcessReaper reaps zombie child processes until ctx is cancelled. This is needed when running as PID 1 (e.g. in a container).
Types ¶
type DaemonConfig ¶
type DaemonConfig struct {
Platform devsy.PlatformOptions `json:"platform"`
Ssh SshConfig `json:"ssh"`
Timeout string `json:"timeout"`
ShutdownAction string `json:"shutdownAction,omitempty"`
}
func BuildWorkspaceDaemonConfig ¶
func BuildWorkspaceDaemonConfig( platformOptions devsy.PlatformOptions, workspaceConfig *provider2.Workspace, substitutionContext *config.SubstitutionContext, mergedConfig *config.MergedDevContainerConfig, ) (*DaemonConfig, error)
type InstallOptions ¶
type InstallOptions struct {
StateLocation StateLocation
Interval string
ShutdownAction string
DiagnosticsReader machinediagnostics.ReaderIdentity
}
type StateLayout ¶
type StateLayout string
StateLayout describes how machine workspace state is stored beneath Root.
const ( StateLayoutCanonical StateLayout = "canonical" StateLayoutAgentHome StateLayout = "agent-home" )
type StateLocation ¶
type StateLocation struct {
Root string
Layout StateLayout
}
StateLocation identifies the workspace state that an inactivity daemon owns.
func ResolveStateLocation ¶
func ResolveStateLocation(opts ResolveStateLocationOptions) (StateLocation, error)
ResolveStateLocation captures the persisted state root at installation time, before the daemon is started by systemd under a potentially different user.
func (StateLocation) Validate ¶
func (l StateLocation) Validate() error
func (StateLocation) WorkspaceConfigPattern ¶
func (l StateLocation) WorkspaceConfigPattern() (string, error)