Documentation
¶
Index ¶
- Constants
- func BuildDockerExecArgs(a DockerExecArgs) []string
- func BuildLifecycleEnvArgs(result *devcconfig.Result) []string
- func ExecLifecycleHook(params *LifecycleExecParams, name string, hook types.LifecycleHook) error
- func NewBuildCmd(flags *cmdflags.GlobalFlags) *cobra.Command
- func NewDeleteCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewDescribeCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewExecCmd(f *flags.GlobalFlags) *cobra.Command
- func NewExportCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewImportCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewListCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewLogsCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewPingCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewRenameCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewSSHCmd(f *flags.GlobalFlags) *cobra.Command
- func NewSetIDECmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewStatusCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- func NewStopCmd(flags *flags.GlobalFlags) *cobra.Command
- func NewTroubleshootCmd(flags *flags.GlobalFlags) *cobra.Command
- func NewWorkspaceCmd(globalFlags *flags.GlobalFlags) *cobra.Command
- type BuildCmd
- type DeleteCmd
- type DescribeCmd
- type DevsyProInstance
- type DockerExecArgs
- type ExecCmd
- type ExportCmd
- type ImportCmd
- type LifecycleExecParams
- type ListCmd
- type LogsCmd
- type PingCmd
- type PrintableError
- type RenameCmd
- type SSHCmd
- type SetIDECmd
- type StatusCmd
- type StopCmd
- type TroubleshootCmd
Constants ¶
const (
DisableSSHKeepAlive time.Duration = 0 * time.Second
)
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 *cmdflags.GlobalFlags) *cobra.Command
NewBuildCmd creates a new command.
func NewDeleteCmd ¶
func NewDeleteCmd(globalFlags *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(globalFlags *flags.GlobalFlags) *cobra.Command
NewExportCmd creates a new command.
func NewImportCmd ¶
func NewImportCmd(globalFlags *flags.GlobalFlags) *cobra.Command
NewImportCmd creates a new command.
func NewListCmd ¶
func NewListCmd(globalFlags *flags.GlobalFlags) *cobra.Command
NewListCmd creates a new destroy command.
func NewLogsCmd ¶
func NewLogsCmd(globalFlags *flags.GlobalFlags) *cobra.Command
NewLogsCmd creates a new destroy command.
func NewPingCmd ¶
func NewPingCmd(globalFlags *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(globalFlags *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 {
*cmdflags.GlobalFlags
provider.CLIOptions
ProviderOptions []string
SkipDelete bool
Machine string
}
BuildCmd holds the cmd flags.
type DeleteCmd ¶
type DeleteCmd struct {
*flags.GlobalFlags
client2.DeleteOptions
}
DeleteCmd holds the delete cmd flags.
type DescribeCmd ¶
type DescribeCmd struct {
*flags.GlobalFlags
Timeout string
}
DescribeCmd holds the cmd flags.
func (*DescribeCmd) Run ¶
func (cmd *DescribeCmd) Run(ctx context.Context, client client2.BaseWorkspaceClient) error
Run runs the command logic.
type DevsyProInstance ¶
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 ImportCmd ¶
type ImportCmd struct {
*flags.GlobalFlags
WorkspaceID string
MachineID string
MachineReuse bool
ProviderID string
ProviderReuse bool
Data string
}
ImportCmd holds the export cmd flags.
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.
type PingCmd ¶
type PingCmd struct {
*flags.GlobalFlags
}
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 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.
type SetIDECmd ¶
type SetIDECmd struct {
*flags.GlobalFlags
Options []string
}
SetIDECmd holds the set-ide cmd flags.
type StatusCmd ¶
type StatusCmd struct {
*flags.GlobalFlags
client2.StatusOptions
Timeout string
}
StatusCmd holds the cmd flags.
type StopCmd ¶
type StopCmd struct {
*flags.GlobalFlags
client2.StopOptions
}
StopCmd holds the destroy cmd flags.
type TroubleshootCmd ¶
type TroubleshootCmd struct {
*flags.GlobalFlags
}