workspace

package
v1.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DisableSSHKeepAlive time.Duration = 0 * time.Second
)
View Source
const DockerExecSubcommand = "exec"

DockerExecSubcommand is the docker subcommand used to exec into a container.

Variables

This section is empty.

Functions

func BuildDockerExecArgs

func BuildDockerExecArgs(a DockerExecArgs) []string

BuildDockerExecArgs assembles the argv passed to `docker exec`.

func BuildLifecycleEnvArgs

func BuildLifecycleEnvArgs(result *devcconfig.Result) []string

BuildLifecycleEnvArgs converts a merged config's RemoteEnv into -e KEY=VALUE pairs suitable for `docker exec`.

func ExecLifecycleHook

func ExecLifecycleHook(params *LifecycleExecParams, name string, hook types.LifecycleHook) error

ExecLifecycleHook runs a single devcontainer lifecycle hook against a container.

func NewBuildCmd

func NewBuildCmd(flags *flags.GlobalFlags) *cobra.Command

NewBuildCmd creates a new command.

func NewDeleteCmd

func NewDeleteCmd(flags *flags.GlobalFlags) *cobra.Command

NewDeleteCmd creates a new command.

func NewDescribeCmd

func NewDescribeCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewDescribeCmd creates a new command.

func NewExecCmd

func NewExecCmd(f *flags.GlobalFlags) *cobra.Command

func NewExportCmd

func NewExportCmd(flags *flags.GlobalFlags) *cobra.Command

NewExportCmd creates a new command.

func NewImportCmd

func NewImportCmd(flags *flags.GlobalFlags) *cobra.Command

NewImportCmd creates a new command.

func NewListCmd

func NewListCmd(flags *flags.GlobalFlags) *cobra.Command

NewListCmd creates a new destroy command.

func NewLogsCmd

func NewLogsCmd(flags *flags.GlobalFlags) *cobra.Command

NewLogsCmd creates a new destroy command.

func NewPingCmd

func NewPingCmd(flags *flags.GlobalFlags) *cobra.Command

func NewRenameCmd

func NewRenameCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewRenameCmd creates a new command for renaming a workspace.

func NewSSHCmd

func NewSSHCmd(f *flags.GlobalFlags) *cobra.Command

NewSSHCmd creates a new ssh command.

func NewSetIDECmd

func NewSetIDECmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewSetIDECmd creates the 'devsy workspace set-ide' command. It assigns an IDE to an existing workspace without starting it. The change is persisted to the workspace config and used on the next 'devsy workspace up'.

func NewStatusCmd

func NewStatusCmd(flags *flags.GlobalFlags) *cobra.Command

NewStatusCmd creates a new command.

func NewStopCmd

func NewStopCmd(flags *flags.GlobalFlags) *cobra.Command

NewStopCmd creates a new destroy command.

func NewTroubleshootCmd

func NewTroubleshootCmd(flags *flags.GlobalFlags) *cobra.Command

func NewWorkspaceCmd

func NewWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command

NewWorkspaceCmd builds the 'devsy workspace' parent command.

Types

type BuildCmd

type BuildCmd struct {
	*flags.GlobalFlags
	provider.CLIOptions

	ProviderOptions []string

	SkipDelete bool
	Machine    string
}

BuildCmd holds the cmd flags.

func (*BuildCmd) Run

func (cmd *BuildCmd) Run(ctx context.Context, client client.WorkspaceClient) error

type DeleteCmd

type DeleteCmd struct {
	*flags.GlobalFlags
	client2.DeleteOptions
}

DeleteCmd holds the delete cmd flags.

func (*DeleteCmd) Run

func (cmd *DeleteCmd) Run(cobraCmd *cobra.Command, args []string) error

Run runs the command logic.

type DescribeCmd

type DescribeCmd struct {
	*flags.GlobalFlags

	Timeout string
}

DescribeCmd holds the cmd flags.

func (*DescribeCmd) Run

Run runs the command logic.

type DevsyProInstance

type DevsyProInstance struct {
	Host         string
	ProviderName string
	Version      string
}

type DockerExecArgs

type DockerExecArgs struct {
	Container       string
	User            string
	EnvArgs         []string
	WorkspaceFolder string
	Command         []string
}

DockerExecArgs collects the inputs for BuildDockerExecArgs. User is optional; when set the lifecycle hook runs as that user, per the devcontainer spec (remoteUser). Without it, root-default exec cannot overwrite files previously created by the remoteUser on storage backends that do not honour CAP_DAC_OVERRIDE across UIDs. See https://containers.dev/implementors/json_reference/ (lifecycle-scripts).

type ExecCmd

type ExecCmd struct {
	*flags.GlobalFlags

	WorkspaceName       string
	WorkspaceFolder     string
	ContainerID         string
	DockerPath          string
	RemoteEnv           []string
	DefaultUserEnvProbe string
	IDLabels            []string
	ContainerDataFolder string
	SkipPostCreate      bool
}

func (*ExecCmd) Run

func (cmd *ExecCmd) Run(ctx context.Context, args []string) error

type ExportCmd

type ExportCmd struct {
	*flags.GlobalFlags
}

ExportCmd holds the export cmd flags.

func (*ExportCmd) Run

func (cmd *ExportCmd) Run(ctx context.Context, devsyConfig *config.Config, args []string) error

Run runs the command logic.

type ImportCmd

type ImportCmd struct {
	*flags.GlobalFlags

	WorkspaceID string

	MachineID    string
	MachineReuse bool

	ProviderID    string
	ProviderReuse bool

	Data string
}

ImportCmd holds the export cmd flags.

func (*ImportCmd) Run

func (cmd *ImportCmd) Run(
	ctx context.Context,
	devsyConfig *config.Config,
) error

type LifecycleExecParams

type LifecycleExecParams struct {
	Ctx         context.Context
	Helper      *docker.DockerHelper
	ContainerID string
	EnvArgs     []string
	Workdir     string
	User        string
}

LifecycleExecParams collects the inputs for ExecLifecycleHook.

type ListCmd

type ListCmd struct {
	*flags.GlobalFlags

	SkipPro bool
}

ListCmd holds the configuration.

func (*ListCmd) Run

func (cmd *ListCmd) Run(ctx context.Context) error

Run runs the command logic.

type LogsCmd

type LogsCmd struct {
	*flags.GlobalFlags
}

LogsCmd holds the configuration.

func (*LogsCmd) Run

func (cmd *LogsCmd) Run(ctx context.Context, args []string) error

Run runs the command logic.

type PingCmd

type PingCmd struct {
	*flags.GlobalFlags
}

func (*PingCmd) Run

func (cmd *PingCmd) Run(ctx context.Context, args []string) error

type PrintableError

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

PrintableError serialises a wrapped error's message via json.Marshal.

func (PrintableError) MarshalJSON

func (p PrintableError) MarshalJSON() ([]byte, error)

type RenameCmd

type RenameCmd struct {
	*flags.GlobalFlags
}

RenameCmd holds the rename cmd flags.

func (*RenameCmd) Run

func (cmd *RenameCmd) Run(ctx context.Context, args []string) error

Run validates inputs, loads config, and executes the workspace rename.

type SSHCmd

type SSHCmd struct {
	*flags.GlobalFlags

	ForwardPortsTimeout string
	ForwardPorts        []string
	ReverseForwardPorts []string
	SendEnvVars         []string
	SetEnvVars          []string

	Stdio                     bool
	JumpContainer             bool
	ReuseSSHAuthSock          string
	AgentForwarding           bool
	GPGAgentForwarding        bool
	GitSSHSignatureForwarding bool
	GitSSHSigningKey          string

	// ssh keepalive options
	SSHKeepAliveInterval time.Duration `json:"sshKeepAliveInterval,omitempty"`

	StartServices   bool
	TermMode        string
	InstallTerminfo bool

	Command string
	User    string
	WorkDir string
}

SSHCmd holds the ssh cmd flags.

func (*SSHCmd) Run

func (cmd *SSHCmd) Run(
	ctx context.Context,
	devsyConfig *config.Config,
	client client2.BaseWorkspaceClient,
) error

Run runs the command logic.

type SetIDECmd

type SetIDECmd struct {
	*flags.GlobalFlags

	Options []string
}

SetIDECmd holds the set-ide cmd flags.

func (*SetIDECmd) Run

func (cmd *SetIDECmd) Run(_ context.Context, workspaceName, ideName string) error

Run validates inputs and applies the IDE assignment to the workspace config.

type StatusCmd

type StatusCmd struct {
	*flags.GlobalFlags
	client2.StatusOptions

	Timeout string
}

StatusCmd holds the cmd flags.

func (*StatusCmd) Run

func (cmd *StatusCmd) Run(
	ctx context.Context,
	client client2.BaseWorkspaceClient,
) error

Run runs the command logic.

type StopCmd

type StopCmd struct {
	*flags.GlobalFlags
	client2.StopOptions
}

StopCmd holds the destroy cmd flags.

func (*StopCmd) Run

func (cmd *StopCmd) Run(
	ctx context.Context,
	devsyConfig *config.Config,
	client client2.BaseWorkspaceClient,
) error

Run runs the command logic.

type TroubleshootCmd

type TroubleshootCmd struct {
	*flags.GlobalFlags
}

func (*TroubleshootCmd) Run

func (cmd *TroubleshootCmd) Run(ctx context.Context, args []string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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