vscodeipc

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const AuthHeader = "Coder-IPC-Token"

Variables

This section is empty.

Functions

func New

New creates a VS Code IPC client that can be used to communicate with workspaces.

Creating this IPC was required instead of using SSH, because we're unable to get connection information to display in the bottom-bar when using SSH. It's possible we could jank around this (maybe by using a temporary SSH host), but that's not ideal.

This persists a single workspace connection, and lets you execute commands, check for network information, and forward ports.

The VS Code extension is located at https://github.com/coder/vscode-coder. The extension downloads the slim binary from `/bin/*` and executes `coder vscodeipc` which calls this function. This API must maintain backward compatibility with the extension to support prior versions of Coder.

Types

type ExecuteRequest

type ExecuteRequest struct {
	Command string `json:"command"`
	Stdin   string `json:"stdin"`
}

type ExecuteResponse

type ExecuteResponse struct {
	Data     string `json:"data"`
	ExitCode *int   `json:"exit_code"`
}

type NetworkResponse

type NetworkResponse struct {
	P2P              bool               `json:"p2p"`
	Latency          float64            `json:"latency"`
	PreferredDERP    string             `json:"preferred_derp"`
	DERPLatency      map[string]float64 `json:"derp_latency"`
	UploadBytesSec   int64              `json:"upload_bytes_sec"`
	DownloadBytesSec int64              `json:"download_bytes_sec"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL