Documentation
¶
Index ¶
- Variables
- func AgentScriptFromProto(protoScript *proto.WorkspaceAgentScript) (codersdk.WorkspaceAgentScript, error)
- func AgentScriptsFromProto(protoScripts []*proto.WorkspaceAgentScript) ([]codersdk.WorkspaceAgentScript, error)
- func AppFromProto(protoApp *proto.WorkspaceApp) (codersdk.WorkspaceApp, error)
- func AppHealthPoster(aAPI BatchUpdateAppHealthsClient) func(ctx context.Context, req PostAppHealthsRequest) error
- func AppsFromProto(protoApps []*proto.WorkspaceApp) ([]codersdk.WorkspaceApp, error)
- func BannerConfigFromProto(sbp *proto.BannerConfig) codersdk.BannerConfig
- func DevcontainerFromProto(pdc *proto.WorkspaceAgentDevcontainer) (codersdk.WorkspaceAgentDevcontainer, error)
- func DevcontainersFromProto(pdcs []*proto.WorkspaceAgentDevcontainer) ([]codersdk.WorkspaceAgentDevcontainer, error)
- func LifecycleStateFromProto(s proto.Lifecycle_State) (codersdk.WorkspaceAgentLifecycle, error)
- func LogsNotifyChannel(agentID uuid.UUID) string
- func LogsSender(sourceID uuid.UUID, patchLogs func(ctx context.Context, req PatchLogs) error, ...) (sendLog func(ctx context.Context, log ...Log) error, ...)deprecated
- func LogsSenderFlushTimeout(timeout time.Duration) func(*logsSenderOptions)
- func LogsWriter(ctx context.Context, sender func(ctx context.Context, log ...Log) error, ...) io.WriteCloser
- func MetadataDescriptionFromProto(description *proto.WorkspaceAgentMetadata_Description) codersdk.WorkspaceAgentMetadataDescription
- func MetadataDescriptionsFromProto(descriptions []*proto.WorkspaceAgentMetadata_Description) []codersdk.WorkspaceAgentMetadataDescription
- func MetadataResultFromProto(r *proto.WorkspaceAgentMetadata_Result) codersdk.WorkspaceAgentMetadataResult
- func ProtoFromApp(a codersdk.WorkspaceApp) (*proto.WorkspaceApp, error)
- func ProtoFromAppHealthsRequest(req PostAppHealthsRequest) (*proto.BatchUpdateAppHealthRequest, error)
- func ProtoFromApps(apps []codersdk.WorkspaceApp) ([]*proto.WorkspaceApp, error)
- func ProtoFromBannerConfig(sb codersdk.BannerConfig) *proto.BannerConfig
- func ProtoFromConnectionType(typ ConnectionType) (proto.Connection_Type, error)
- func ProtoFromDevcontainer(dc codersdk.WorkspaceAgentDevcontainer) *proto.WorkspaceAgentDevcontainer
- func ProtoFromDevcontainers(dcs []codersdk.WorkspaceAgentDevcontainer) []*proto.WorkspaceAgentDevcontainer
- func ProtoFromLifecycle(req PostLifecycleRequest) (*proto.Lifecycle, error)
- func ProtoFromLifecycleState(s codersdk.WorkspaceAgentLifecycle) (proto.Lifecycle_State, error)
- func ProtoFromLog(log Log) (*proto.Log, error)
- func ProtoFromManifest(manifest Manifest) (*proto.Manifest, error)
- func ProtoFromMetadataDescription(d codersdk.WorkspaceAgentMetadataDescription) *proto.WorkspaceAgentMetadata_Description
- func ProtoFromMetadataDescriptions(descriptions []codersdk.WorkspaceAgentMetadataDescription) []*proto.WorkspaceAgentMetadata_Description
- func ProtoFromMetadataResult(r codersdk.WorkspaceAgentMetadataResult) *proto.WorkspaceAgentMetadata_Result
- func ProtoFromScript(s codersdk.WorkspaceAgentScript) *proto.WorkspaceAgentScript
- func ProtoFromScripts(scripts []codersdk.WorkspaceAgentScript) []*proto.WorkspaceAgentScript
- func ProtoFromServiceBanner(sb codersdk.BannerConfig) *proto.ServiceBanner
- func ProtoFromSubsystems(ss []codersdk.AgentSubsystem) ([]proto.Startup_Subsystem, error)
- func ServiceBannerFromProto(sbp *proto.ServiceBanner) codersdk.BannerConfig
- type AWSInstanceIdentityToken
- type AgentMetric
- type AgentMetricLabel
- type AgentMetricType
- type AuthenticateResponse
- type AzureInstanceIdentityToken
- type BatchUpdateAppHealthsClient
- type Client
- func (c *Client) AuthAWSInstanceIdentity(ctx context.Context) (AuthenticateResponse, error)
- func (c *Client) AuthAzureInstanceIdentity(ctx context.Context) (AuthenticateResponse, error)
- func (c *Client) AuthGoogleInstanceIdentity(ctx context.Context, serviceAccount string, gcpClient *metadata.Client) (AuthenticateResponse, error)
- func (c *Client) ConnectRPC(ctx context.Context) (drpc.Conn, error)
- func (c *Client) ConnectRPC20(ctx context.Context) (proto.DRPCAgentClient20, error)
- func (c *Client) ConnectRPC20WithTailnet(ctx context.Context) (proto.DRPCAgentClient20, tailnetproto.DRPCTailnetClient20, error)
- func (c *Client) ConnectRPC21(ctx context.Context) (proto.DRPCAgentClient21, error)
- func (c *Client) ConnectRPC21WithTailnet(ctx context.Context) (proto.DRPCAgentClient21, tailnetproto.DRPCTailnetClient21, error)
- func (c *Client) ConnectRPC22(ctx context.Context) (proto.DRPCAgentClient22, tailnetproto.DRPCTailnetClient22, error)
- func (c *Client) ConnectRPC23(ctx context.Context) (proto.DRPCAgentClient23, tailnetproto.DRPCTailnetClient23, error)
- func (c *Client) ConnectRPC24(ctx context.Context) (proto.DRPCAgentClient24, tailnetproto.DRPCTailnetClient24, error)
- func (c *Client) ExternalAuth(ctx context.Context, req ExternalAuthRequest) (ExternalAuthResponse, error)
- func (c *Client) GitSSHKey(ctx context.Context) (GitSSHKey, error)
- func (c *Client) PatchAppStatus(ctx context.Context, req PatchAppStatus) error
- func (c *Client) PatchLogs(ctx context.Context, req PatchLogs) errordeprecated
- func (c *Client) PostLogSource(ctx context.Context, req PostLogSourceRequest) (codersdk.WorkspaceAgentLogSource, error)
- func (c *Client) RewriteDERPMap(derpMap *tailcfg.DERPMap)
- func (c *Client) SetSessionToken(token string)
- type ConnectionType
- type ExternalAuthRequest
- type ExternalAuthResponse
- type GitSSHKey
- type GoogleInstanceIdentityToken
- type Log
- type LogDest
- type LogSender
- func (l *LogSender) Enqueue(src uuid.UUID, logs ...Log)
- func (l *LogSender) Flush(src uuid.UUID)
- func (l *LogSender) GetScriptLogger(logSourceID uuid.UUID) ScriptLogger
- func (l *LogSender) SendLoop(ctx context.Context, dest LogDest) error
- func (l *LogSender) WaitUntilEmpty(ctx context.Context) error
- type LogSource
- type LogsNotifyMessage
- type Manifest
- type Metadata
- type PatchAppStatus
- type PatchLogs
- type PostAppHealthsRequest
- type PostLifecycleRequest
- type PostLogSourceRequest
- type PostMetadataRequest
- type PostMetadataRequestDeprecated
- type PostStartupRequest
- type Script
- type ScriptLogger
- type Stats
- type StatsResponse
Constants ¶
This section is empty.
Variables ¶
var ErrLogLimitExceeded = xerrors.New("Log limit exceeded")
var ExternalLogSourceID = uuid.MustParse("3b579bf4-1ed8-4b99-87a8-e9a1e3410410")
ExternalLogSourceID is the statically-defined ID of a log-source that appears as "External" in the dashboard.
This is to support legacy API-consumers that do not create their own log-source. This should be removed in the future.
Functions ¶
func AgentScriptFromProto ¶ added in v2.8.0
func AgentScriptFromProto(protoScript *proto.WorkspaceAgentScript) (codersdk.WorkspaceAgentScript, error)
func AgentScriptsFromProto ¶ added in v2.8.0
func AgentScriptsFromProto(protoScripts []*proto.WorkspaceAgentScript) ([]codersdk.WorkspaceAgentScript, error)
func AppFromProto ¶ added in v2.8.0
func AppFromProto(protoApp *proto.WorkspaceApp) (codersdk.WorkspaceApp, error)
func AppHealthPoster ¶ added in v2.8.0
func AppHealthPoster(aAPI BatchUpdateAppHealthsClient) func(ctx context.Context, req PostAppHealthsRequest) error
func AppsFromProto ¶ added in v2.8.0
func AppsFromProto(protoApps []*proto.WorkspaceApp) ([]codersdk.WorkspaceApp, error)
func BannerConfigFromProto ¶ added in v2.12.0
func BannerConfigFromProto(sbp *proto.BannerConfig) codersdk.BannerConfig
func DevcontainerFromProto ¶ added in v2.21.0
func DevcontainerFromProto(pdc *proto.WorkspaceAgentDevcontainer) (codersdk.WorkspaceAgentDevcontainer, error)
func DevcontainersFromProto ¶ added in v2.21.0
func DevcontainersFromProto(pdcs []*proto.WorkspaceAgentDevcontainer) ([]codersdk.WorkspaceAgentDevcontainer, error)
func LifecycleStateFromProto ¶ added in v2.9.0
func LifecycleStateFromProto(s proto.Lifecycle_State) (codersdk.WorkspaceAgentLifecycle, error)
func LogsNotifyChannel ¶
LogsNotifyChannel returns the channel name responsible for notifying of new logs.
func LogsSender
deprecated
func LogsSender(sourceID uuid.UUID, patchLogs func(ctx context.Context, req PatchLogs) error, logger slog.Logger, opts ...func(*logsSenderOptions)) (sendLog func(ctx context.Context, log ...Log) error, flushAndClose func(context.Context) error)
LogsSender will send agent startup logs to the server. Calls to sendLog are non-blocking and will return an error if flushAndClose has been called. Calling sendLog concurrently is not supported. If the context passed to flushAndClose is canceled, any remaining logs will be discarded.
Deprecated: Use NewLogSender instead, based on the v2 Agent API.
func LogsSenderFlushTimeout ¶ added in v2.3.0
LogsSenderFlushTimeout changes the default flush timeout (250ms), this is mostly useful for tests.
func LogsWriter ¶ added in v2.2.0
func LogsWriter(ctx context.Context, sender func(ctx context.Context, log ...Log) error, source uuid.UUID, level codersdk.LogLevel) io.WriteCloser
LogsWriter returns an io.WriteCloser that sends logs via the provided sender. The sender is expected to be non-blocking. Calling Close flushes any remaining partially written log lines but is otherwise no-op. If the context passed to LogsWriter is canceled, any remaining logs will be discarded.
Neither Write nor Close is safe for concurrent use and must be used by a single goroutine.
func MetadataDescriptionFromProto ¶ added in v2.8.0
func MetadataDescriptionFromProto(description *proto.WorkspaceAgentMetadata_Description) codersdk.WorkspaceAgentMetadataDescription
func MetadataDescriptionsFromProto ¶ added in v2.8.0
func MetadataDescriptionsFromProto(descriptions []*proto.WorkspaceAgentMetadata_Description) []codersdk.WorkspaceAgentMetadataDescription
func MetadataResultFromProto ¶ added in v2.9.0
func MetadataResultFromProto(r *proto.WorkspaceAgentMetadata_Result) codersdk.WorkspaceAgentMetadataResult
func ProtoFromApp ¶ added in v2.8.0
func ProtoFromApp(a codersdk.WorkspaceApp) (*proto.WorkspaceApp, error)
func ProtoFromAppHealthsRequest ¶ added in v2.8.0
func ProtoFromAppHealthsRequest(req PostAppHealthsRequest) (*proto.BatchUpdateAppHealthRequest, error)
func ProtoFromApps ¶ added in v2.8.0
func ProtoFromApps(apps []codersdk.WorkspaceApp) ([]*proto.WorkspaceApp, error)
func ProtoFromBannerConfig ¶ added in v2.12.0
func ProtoFromBannerConfig(sb codersdk.BannerConfig) *proto.BannerConfig
func ProtoFromConnectionType ¶ added in v2.20.0
func ProtoFromConnectionType(typ ConnectionType) (proto.Connection_Type, error)
func ProtoFromDevcontainer ¶ added in v2.21.0
func ProtoFromDevcontainer(dc codersdk.WorkspaceAgentDevcontainer) *proto.WorkspaceAgentDevcontainer
func ProtoFromDevcontainers ¶ added in v2.21.0
func ProtoFromDevcontainers(dcs []codersdk.WorkspaceAgentDevcontainer) []*proto.WorkspaceAgentDevcontainer
func ProtoFromLifecycle ¶ added in v2.9.0
func ProtoFromLifecycle(req PostLifecycleRequest) (*proto.Lifecycle, error)
func ProtoFromLifecycleState ¶ added in v2.13.0
func ProtoFromLifecycleState(s codersdk.WorkspaceAgentLifecycle) (proto.Lifecycle_State, error)
func ProtoFromManifest ¶ added in v2.8.0
func ProtoFromMetadataDescription ¶ added in v2.8.0
func ProtoFromMetadataDescription(d codersdk.WorkspaceAgentMetadataDescription) *proto.WorkspaceAgentMetadata_Description
func ProtoFromMetadataDescriptions ¶ added in v2.8.0
func ProtoFromMetadataDescriptions(descriptions []codersdk.WorkspaceAgentMetadataDescription) []*proto.WorkspaceAgentMetadata_Description
func ProtoFromMetadataResult ¶ added in v2.9.0
func ProtoFromMetadataResult(r codersdk.WorkspaceAgentMetadataResult) *proto.WorkspaceAgentMetadata_Result
func ProtoFromScript ¶ added in v2.8.0
func ProtoFromScript(s codersdk.WorkspaceAgentScript) *proto.WorkspaceAgentScript
func ProtoFromScripts ¶ added in v2.8.0
func ProtoFromScripts(scripts []codersdk.WorkspaceAgentScript) []*proto.WorkspaceAgentScript
func ProtoFromServiceBanner ¶ added in v2.8.0
func ProtoFromServiceBanner(sb codersdk.BannerConfig) *proto.ServiceBanner
func ProtoFromSubsystems ¶ added in v2.8.0
func ProtoFromSubsystems(ss []codersdk.AgentSubsystem) ([]proto.Startup_Subsystem, error)
func ServiceBannerFromProto ¶ added in v2.8.0
func ServiceBannerFromProto(sbp *proto.ServiceBanner) codersdk.BannerConfig
Types ¶
type AgentMetric ¶
type AgentMetric struct { Name string `json:"name" validate:"required"` Type AgentMetricType `json:"type" validate:"required" enums:"counter,gauge"` Value float64 `json:"value" validate:"required"` Labels []AgentMetricLabel `json:"labels,omitempty"` }
type AgentMetricLabel ¶
type AgentMetricType ¶
type AgentMetricType string
const ( AgentMetricTypeCounter AgentMetricType = "counter" AgentMetricTypeGauge AgentMetricType = "gauge" )
type AuthenticateResponse ¶
type AuthenticateResponse struct {
SessionToken string `json:"session_token"`
}
AuthenticateResponse is returned when an instance ID has been exchanged for a session token. @typescript-ignore AuthenticateResponse
type BatchUpdateAppHealthsClient ¶ added in v2.9.0
type BatchUpdateAppHealthsClient interface {
BatchUpdateAppHealths(ctx context.Context, req *proto.BatchUpdateAppHealthRequest) (*proto.BatchUpdateAppHealthResponse, error)
}
BatchUpdateAppHealthsClient is a partial interface of proto.DRPCAgentClient.
type Client ¶
Client wraps `codersdk.Client` with specific functions scoped to a workspace agent.
func (*Client) AuthAWSInstanceIdentity ¶
func (c *Client) AuthAWSInstanceIdentity(ctx context.Context) (AuthenticateResponse, error)
AuthWorkspaceAWSInstanceIdentity uses the Amazon Metadata API to fetch a signed payload, and exchange it for a session token for a workspace agent.
The requesting instance must be registered as a resource in the latest history for a workspace.
func (*Client) AuthAzureInstanceIdentity ¶
func (c *Client) AuthAzureInstanceIdentity(ctx context.Context) (AuthenticateResponse, error)
AuthWorkspaceAzureInstanceIdentity uses the Azure Instance Metadata Service to fetch a signed payload, and exchange it for a session token for a workspace agent.
func (*Client) AuthGoogleInstanceIdentity ¶
func (c *Client) AuthGoogleInstanceIdentity(ctx context.Context, serviceAccount string, gcpClient *metadata.Client) (AuthenticateResponse, error)
AuthWorkspaceGoogleInstanceIdentity uses the Google Compute Engine Metadata API to fetch a signed JWT, and exchange it for a session token for a workspace agent.
The requesting instance must be registered as a resource in the latest history for a workspace.
func (*Client) ConnectRPC ¶ added in v2.8.0
ConnectRPC connects to the workspace agent API and tailnet API
func (*Client) ConnectRPC20 ¶ added in v2.14.0
ConnectRPC20 returns a dRPC client to the Agent API v2.0. Notably, it is missing GetAnnouncementBanners, but is useful when you want to be maximally compatible with Coderd Release Versions from 2.9+ Deprecated: use ConnectRPC20WithTailnet
func (*Client) ConnectRPC20WithTailnet ¶ added in v2.18.0
func (c *Client) ConnectRPC20WithTailnet(ctx context.Context) ( proto.DRPCAgentClient20, tailnetproto.DRPCTailnetClient20, error, )
ConnectRPC20WithTailnet returns a dRPC client to the Agent API v2.0. Notably, it is missing GetAnnouncementBanners, but is useful when you want to be maximally compatible with Coderd Release Versions from 2.9+
func (*Client) ConnectRPC21 ¶ added in v2.14.0
ConnectRPC21 returns a dRPC client to the Agent API v2.1. It is useful when you want to be maximally compatible with Coderd Release Versions from 2.12+ Deprecated: use ConnectRPC21WithTailnet
func (*Client) ConnectRPC21WithTailnet ¶ added in v2.18.0
func (c *Client) ConnectRPC21WithTailnet(ctx context.Context) ( proto.DRPCAgentClient21, tailnetproto.DRPCTailnetClient21, error, )
ConnectRPC21WithTailnet returns a dRPC client to the Agent API v2.1. It is useful when you want to be maximally compatible with Coderd Release Versions from 2.12+
func (*Client) ConnectRPC22 ¶ added in v2.18.0
func (c *Client) ConnectRPC22(ctx context.Context) ( proto.DRPCAgentClient22, tailnetproto.DRPCTailnetClient22, error, )
ConnectRPC22 returns a dRPC client to the Agent API v2.2. It is useful when you want to be maximally compatible with Coderd Release Versions from 2.13+
func (*Client) ConnectRPC23 ¶ added in v2.18.0
func (c *Client) ConnectRPC23(ctx context.Context) ( proto.DRPCAgentClient23, tailnetproto.DRPCTailnetClient23, error, )
ConnectRPC23 returns a dRPC client to the Agent API v2.3. It is useful when you want to be maximally compatible with Coderd Release Versions from 2.18+
func (*Client) ConnectRPC24 ¶ added in v2.20.0
func (c *Client) ConnectRPC24(ctx context.Context) ( proto.DRPCAgentClient24, tailnetproto.DRPCTailnetClient24, error, )
ConnectRPC24 returns a dRPC client to the Agent API v2.4. It is useful when you want to be maximally compatible with Coderd Release Versions from 2.xx+ // TODO @vincent: define version
func (*Client) ExternalAuth ¶ added in v2.3.0
func (c *Client) ExternalAuth(ctx context.Context, req ExternalAuthRequest) (ExternalAuthResponse, error)
ExternalAuth submits a URL or provider ID to fetch an access token for. nolint:revive
func (*Client) PatchAppStatus ¶ added in v2.21.0
func (c *Client) PatchAppStatus(ctx context.Context, req PatchAppStatus) error
func (*Client) PostLogSource ¶ added in v2.2.0
func (c *Client) PostLogSource(ctx context.Context, req PostLogSourceRequest) (codersdk.WorkspaceAgentLogSource, error)
func (*Client) RewriteDERPMap ¶ added in v2.8.0
RewriteDERPMap rewrites the DERP map to use the access URL of the SDK as the "embedded relay" access URL. The passed derp map is modified in place.
Agents can provide an arbitrary access URL that may be different that the globally configured one. This breaks the built-in DERP, which would continue to reference the global access URL.
func (*Client) SetSessionToken ¶
type ConnectionType ¶ added in v2.20.0
type ConnectionType string
ConnectionType is the type of connection that the agent is receiving.
const ( ConnectionTypeUnspecified ConnectionType = "Unspecified" ConnectionTypeSSH ConnectionType = "SSH" ConnectionTypeVSCode ConnectionType = "VS Code" ConnectionTypeJetBrains ConnectionType = "JetBrains" ConnectionTypeReconnectingPTY ConnectionType = "Web Terminal" )
Connection type enums.
func ConnectionTypeFromProto ¶ added in v2.20.0
func ConnectionTypeFromProto(typ proto.Connection_Type) (ConnectionType, error)
type ExternalAuthRequest ¶ added in v2.3.0
type ExternalAuthRequest struct { // ID is the ID of a provider to request authentication for. ID string // Match is an arbitrary string matched against the regex of the provider. Match string // Listen indicates that the request should be long-lived and listen for // a new token to be requested. Listen bool }
ExternalAuthRequest is used to request an access token for a provider. Either ID or Match must be specified, but not both.
type ExternalAuthResponse ¶ added in v2.3.0
type ExternalAuthResponse struct { AccessToken string `json:"access_token"` TokenExtra map[string]interface{} `json:"token_extra"` URL string `json:"url"` Type string `json:"type"` // Deprecated: Only supported on `/workspaceagents/me/gitauth` // for backwards compatibility. Username string `json:"username"` Password string `json:"password"` }
type GoogleInstanceIdentityToken ¶
type GoogleInstanceIdentityToken struct {
JSONWebToken string `json:"json_web_token" validate:"required"`
}
type LogDest ¶ added in v2.14.0
type LogDest interface {
BatchCreateLogs(ctx context.Context, request *proto.BatchCreateLogsRequest) (*proto.BatchCreateLogsResponse, error)
}
type LogSender ¶ added in v2.9.0
LogSender is a component that handles enqueuing logs and then sending them over the agent API. Things that need to log call Enqueue and Flush. When the agent API becomes available, call SendLoop to send pending logs.
func NewLogSender ¶ added in v2.9.0
func (*LogSender) GetScriptLogger ¶ added in v2.9.0
func (l *LogSender) GetScriptLogger(logSourceID uuid.UUID) ScriptLogger
type LogsNotifyMessage ¶
type LogsNotifyMessage struct {
CreatedAfter int64 `json:"created_after"`
}
type Manifest ¶
type Manifest struct { AgentID uuid.UUID `json:"agent_id"` AgentName string `json:"agent_name"` // OwnerName and WorkspaceID are used by an open-source user to identify the workspace. // We do not provide insurance that this will not be removed in the future, // but if it's easy to persist lets keep it around. OwnerName string `json:"owner_name"` WorkspaceID uuid.UUID `json:"workspace_id"` WorkspaceName string `json:"workspace_name"` // GitAuthConfigs stores the number of Git configurations // the Coder deployment has. If this number is >0, we // set up special configuration in the workspace. GitAuthConfigs int `json:"git_auth_configs"` VSCodePortProxyURI string `json:"vscode_port_proxy_uri"` Apps []codersdk.WorkspaceApp `json:"apps"` DERPMap *tailcfg.DERPMap `json:"derpmap"` DERPForceWebSockets bool `json:"derp_force_websockets"` EnvironmentVariables map[string]string `json:"environment_variables"` Directory string `json:"directory"` MOTDFile string `json:"motd_file"` DisableDirectConnections bool `json:"disable_direct_connections"` Metadata []codersdk.WorkspaceAgentMetadataDescription `json:"metadata"` Scripts []codersdk.WorkspaceAgentScript `json:"scripts"` Devcontainers []codersdk.WorkspaceAgentDevcontainer `json:"devcontainers"` }
type Metadata ¶ added in v2.3.1
type Metadata struct { Key string `json:"key"` codersdk.WorkspaceAgentMetadataResult }
func MetadataFromProto ¶ added in v2.9.0
type PatchAppStatus ¶ added in v2.21.0
type PatchAppStatus struct { AppSlug string `json:"app_slug"` NeedsUserAttention bool `json:"needs_user_attention"` State codersdk.WorkspaceAppStatusState `json:"state"` Message string `json:"message"` URI string `json:"uri"` Icon string `json:"icon"` }
PatchAppStatus updates the status of a workspace app.
type PostAppHealthsRequest ¶
type PostAppHealthsRequest struct { // Healths is a map of the workspace app name and the health of the app. Healths map[uuid.UUID]codersdk.WorkspaceAppHealth }
type PostLifecycleRequest ¶
type PostLifecycleRequest struct { State codersdk.WorkspaceAgentLifecycle `json:"state"` ChangedAt time.Time `json:"changed_at"` }
type PostLogSourceRequest ¶ added in v2.13.0
type PostLogSourceRequest struct { // ID is a unique identifier for the log source. // It is scoped to a workspace agent, and can be statically // defined inside code to prevent duplicate sources from being // created for the same agent. ID uuid.UUID `json:"id"` DisplayName string `json:"display_name"` Icon string `json:"icon"` }
type PostMetadataRequest ¶
type PostMetadataRequest struct {
Metadata []Metadata `json:"metadata"`
}
type PostMetadataRequestDeprecated ¶ added in v2.3.1
type PostMetadataRequestDeprecated = codersdk.WorkspaceAgentMetadataResult
In the future, we may want to support sending back multiple values for performance.
type PostStartupRequest ¶
type PostStartupRequest struct { Version string `json:"version"` ExpandedDirectory string `json:"expanded_directory"` Subsystems []codersdk.AgentSubsystem `json:"subsystems"` }
type ScriptLogger ¶ added in v2.9.0
type ScriptLogger struct {
// contains filtered or unexported fields
}
type Stats ¶
type Stats struct { // ConnectionsByProto is a count of connections by protocol. ConnectionsByProto map[string]int64 `json:"connections_by_proto"` // ConnectionCount is the number of connections received by an agent. ConnectionCount int64 `json:"connection_count"` // ConnectionMedianLatencyMS is the median latency of all connections in milliseconds. ConnectionMedianLatencyMS float64 `json:"connection_median_latency_ms"` // RxPackets is the number of received packets. RxPackets int64 `json:"rx_packets"` // RxBytes is the number of received bytes. RxBytes int64 `json:"rx_bytes"` // TxPackets is the number of transmitted bytes. TxPackets int64 `json:"tx_packets"` // TxBytes is the number of transmitted bytes. TxBytes int64 `json:"tx_bytes"` // SessionCountVSCode is the number of connections received by an agent // that are from our VS Code extension. SessionCountVSCode int64 `json:"session_count_vscode"` // SessionCountJetBrains is the number of connections received by an agent // that are from our JetBrains extension. SessionCountJetBrains int64 `json:"session_count_jetbrains"` // SessionCountReconnectingPTY is the number of connections received by an agent // that are from the reconnecting web terminal. SessionCountReconnectingPTY int64 `json:"session_count_reconnecting_pty"` // SessionCountSSH is the number of connections received by an agent // that are normal, non-tagged SSH sessions. SessionCountSSH int64 `json:"session_count_ssh"` // Metrics collected by the agent Metrics []AgentMetric `json:"metrics"` }
Stats records the Agent's network connection statistics for use in user-facing metrics and debugging.