Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProtocolReconnectingPTY = "reconnecting-pty" ProtocolSSH = "ssh" ProtocolDial = "dial" // MagicSessionErrorCode indicates that something went wrong with the session, rather than the // command just returning a nonzero exit code, and is chosen as an arbitrary, high number // unlikely to shadow other exit codes, which are typically 1, 2, 3, etc. MagicSessionErrorCode = 229 // MagicSSHSessionTypeEnvironmentVariable is used to track the purpose behind an SSH connection. // This is stripped from any commands being executed, and is counted towards connection stats. MagicSSHSessionTypeEnvironmentVariable = "CODER_SSH_SESSION_TYPE" // MagicSSHSessionTypeVSCode is set in the SSH config by the VS Code extension to identify itself. MagicSSHSessionTypeVSCode = "vscode" // MagicSSHSessionTypeJetBrains is set in the SSH config by the JetBrains extension to identify itself. MagicSSHSessionTypeJetBrains = "jetbrains" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v0.11.0
type Client interface { Manifest(ctx context.Context) (agentsdk.Manifest, error) Listen(ctx context.Context) (net.Conn, error) ReportStats(ctx context.Context, log slog.Logger, statsChan <-chan *agentsdk.Stats, setInterval func(time.Duration)) (io.Closer, error) PostLifecycle(ctx context.Context, state agentsdk.PostLifecycleRequest) error PostAppHealth(ctx context.Context, req agentsdk.PostAppHealthsRequest) error PostStartup(ctx context.Context, req agentsdk.PostStartupRequest) error PostMetadata(ctx context.Context, key string, req agentsdk.PostMetadataRequest) error PatchStartupLogs(ctx context.Context, req agentsdk.PatchStartupLogs) error }
type Options ¶
type Options struct { Filesystem afero.Fs LogDir string TempDir string ExchangeToken func(ctx context.Context) (string, error) Client Client ReconnectingPTYTimeout time.Duration EnvironmentVariables map[string]string Logger slog.Logger AgentPorts map[int]string SSHMaxTimeout time.Duration TailnetListenPort uint16 }
type PostWorkspaceAgentAppHealth ¶ added in v0.9.0
type PostWorkspaceAgentAppHealth func(context.Context, agentsdk.PostAppHealthsRequest) error
PostWorkspaceAgentAppHealth updates the workspace app health.
type WorkspaceAgentApps ¶ added in v0.9.0
type WorkspaceAgentApps func(context.Context) ([]codersdk.WorkspaceApp, error)
WorkspaceAgentApps fetches the workspace apps.
type WorkspaceAppHealthReporter ¶ added in v0.9.0
WorkspaceAppHealthReporter is a function that checks and reports the health of the workspace apps until the passed context is canceled.
func NewWorkspaceAppHealthReporter ¶ added in v0.9.0
func NewWorkspaceAppHealthReporter(logger slog.Logger, apps []codersdk.WorkspaceApp, postWorkspaceAgentAppHealth PostWorkspaceAgentAppHealth) WorkspaceAppHealthReporter
NewWorkspaceAppHealthReporter creates a WorkspaceAppHealthReporter that reports app health to coderd.
Click to show internal directories.
Click to hide internal directories.