Documentation ¶
Index ¶
- Constants
- func Bicopy(ctx context.Context, c1, c2 io.ReadWriteCloser)
- func ExpandRelativeHomePath(in string) (string, error)
- func New(options Options) io.Closer
- type CoordinatorDialer
- type FetchMetadata
- type Options
- type PostWorkspaceAgentAppHealth
- type Stats
- type StatsReporter
- type WorkspaceAgentApps
- type WorkspaceAppHealthReporter
Constants ¶
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 )
Variables ¶
This section is empty.
Functions ¶
func Bicopy ¶ added in v0.5.11
func Bicopy(ctx context.Context, c1, c2 io.ReadWriteCloser)
Bicopy copies all of the data between the two connections and will close them after one or both of them are done writing. If the context is canceled, both of the connections will be closed.
func ExpandRelativeHomePath ¶ added in v0.5.11
ExpandRelativeHomePath expands the tilde at the beginning of a path to the current user's home directory and returns a full absolute path.
Types ¶
type CoordinatorDialer ¶ added in v0.8.11
CoordinatorDialer is a function that constructs a new broker. A dialer must be passed in to allow for reconnects.
type FetchMetadata ¶ added in v0.8.11
type FetchMetadata func(context.Context) (codersdk.WorkspaceAgentMetadata, error)
FetchMetadata is a function to obtain metadata for the agent.
type Options ¶
type Options struct { CoordinatorDialer CoordinatorDialer FetchMetadata FetchMetadata StatsReporter StatsReporter WorkspaceAgentApps WorkspaceAgentApps PostWorkspaceAgentAppHealth PostWorkspaceAgentAppHealth ReconnectingPTYTimeout time.Duration EnvironmentVariables map[string]string Logger slog.Logger }
type PostWorkspaceAgentAppHealth ¶ added in v0.9.0
type PostWorkspaceAgentAppHealth func(context.Context, codersdk.PostWorkspaceAppHealthsRequest) error
PostWorkspaceAgentAppHealth updates the workspace app health.
type Stats ¶ added in v0.8.12
type Stats struct { NumConns int64 `json:"num_comms"` RxBytes int64 `json:"rx_bytes"` TxBytes int64 `json:"tx_bytes"` }
Stats records the Agent's network connection statistics for use in user-facing metrics and debugging. Each member value must be written and read with atomic.
func (*Stats) Copy ¶ added in v0.8.12
func (s *Stats) Copy() *codersdk.AgentStats
type StatsReporter ¶ added in v0.8.12
type StatsReporter func( ctx context.Context, log slog.Logger, stats func() *codersdk.AgentStats, ) (io.Closer, error)
StatsReporter periodically accept and records agent stats.
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, workspaceAgentApps WorkspaceAgentApps, postWorkspaceAgentAppHealth PostWorkspaceAgentAppHealth) WorkspaceAppHealthReporter
NewWorkspaceAppHealthReporter creates a WorkspaceAppHealthReporter that reports app health to coderd.