codeserver

package
v1.4.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForwardPortsOption  = "FORWARD_PORTS"
	BindAddressOption   = "BIND_ADDRESS"
	VersionOption       = "VERSION"
	DownloadAmd64Option = "DOWNLOAD_AMD64"
	DownloadArm64Option = "DOWNLOAD_ARM64"
)
View Source
const DefaultCodeServerPort = 10801

DefaultCodeServerPort sits next to openvscode's 10800 so a host running both IDEs only collides under the FindAvailablePort fallback path, not by default.

Variables

View Source
var Options = ide.Options{
	ForwardPortsOption: {
		Name:        ForwardPortsOption,
		Description: "If Devsy should automatically do port-forwarding",
		Default:     "true",
		Enum:        []string{"true", "false"},
	},
	BindAddressOption: {
		Name:        BindAddressOption,
		Description: "The address to bind code-server to locally, e.g. 0.0.0.0:12345",
		Default:     "",
	},
	VersionOption: {
		Name:        VersionOption,
		Description: "The version for the code-server binary (without the leading v)",
		Default:     "4.121.0",
	},
	DownloadArm64Option: {
		Name:        DownloadArm64Option,
		Description: "The download url for the arm64 code-server binary",
	},
	DownloadAmd64Option: {
		Name:        DownloadAmd64Option,
		Description: "The download url for the amd64 code-server binary",
	},
}

Functions

This section is empty.

Types

type CodeServer

type CodeServer struct {
	// contains filtered or unexported fields
}

CodeServer installs and runs code-server (coder.com) inside the workspace.

func NewCodeServer

func NewCodeServer(opts ServerOptions) *CodeServer

func (*CodeServer) Install

func (c *CodeServer) Install() error

Install downloads the code-server release tarball, extracts it under <home>/.code-server, and writes settings.json. Idempotent: returns nil without re-downloading when the binary is already present.

func (*CodeServer) InstallExtensions

func (c *CodeServer) InstallExtensions() error

InstallExtensions installs each requested extension via the code-server CLI. Partial failures are logged and tolerated; an aggregated error is returned only when every requested extension fails to install.

func (*CodeServer) Start

func (c *CodeServer) Start() error

Start launches code-server as a background process bound to host:port. Idempotent via command.StartBackgroundOnce.

type ServerOptions

type ServerOptions struct {
	Extensions []string
	Settings   string
	UserName   string
	Host       string
	Port       string
	Values     map[string]config.OptionValue
}

ServerOptions configures a CodeServer instance.

Jump to

Keyboard shortcuts

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