devcontainer

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerVimArgs

func DockerVimArgs(containerID string, workspaceFolder string, vimFileName string) []string

func Down

func Down(args []string, devcontainerPath string, configDirForDevcontainer string) error

func Execute

func Execute(devcontainerFilePath string, args ...string) (string, error)

func ExecuteCombineOutput

func ExecuteCombineOutput(devcontainerFilePath string, args ...string) (string, error)

func GetConfigFilePath

func GetConfigFilePath(readConfigurationCommandResult string) (string, error)

func GetConfigurationFilePath

func GetConfigurationFilePath(devcontainerFilePath string, workspaceFolder string) (string, error)

func GetContainerID

func GetContainerID(upCommandResult string) (string, error)

func ReadConfiguration

func ReadConfiguration(devcontainerFilePath string, readConfiguration ...string) (string, error)

func Start

func Start(args []string, devcontainerPath string, vimFilePath string, cdrPath, configFilePath string, vimrc string) error

devcontainer でコンテナを立ち上げ、 Vim を転送し、実行する。 既存実装の都合上、configFilePath から configDirForDevcontainer を抽出している

func Stop

func Stop(args []string, devcontainerPath string, configDirForDevcontainer string) error

func Templates

func Templates(
	devcontainerFilePath string,
	workspaceFolder string,
	templateID string) (string, error)

Types

type ConfigFilePath

type ConfigFilePath struct {
	FsPath string `json:"fsPath"`
}

type Configuration

type Configuration struct {
	ConfigFilePath ConfigFilePath `json:"configFilePath"`
}

type DevcontainerJSON

type DevcontainerJSON struct {
	DockerComposeFile interface{} `json:"dockerComposeFile"`
}

devcontainer.json のスキーマ(の一部)

func UnmarshalDevcontainerJSON

func UnmarshalDevcontainerJSON(data []byte) (DevcontainerJSON, error)

type ReadConfigurationCommandResult

type ReadConfigurationCommandResult struct {
	Configuration Configuration `json:"configuration"`
}

`devcontainers read-configuration` コマンドの実行結果スキーマ

Example:	{
						"configuration":{
							"name":"development environment",
							"dockerComposeFile":[
								"../docker-compose.yaml"
							],
							"service":"app",
							"workspaceFolder":"/work",
							"remoteUser":"root",
							"configFilePath": {
								"$mid":1,
								"fsPath":"/home/mikoto/project/oasiz-mqtt-client/.devcontainer/devcontainer.json",
								"path":"/home/mikoto/project/oasiz-mqtt-client/.devcontainer/devcontainer.json",
								"scheme":"vscode-fileHost"
							}
						},
						"workspace": {
							"workspaceFolder":"/work"
						}
					}

func UnmarshalReadConfigurationCommandResult

func UnmarshalReadConfigurationCommandResult(data []byte) (ReadConfigurationCommandResult, error)

type ReadConfigurationError

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

func (*ReadConfigurationError) Error

func (e *ReadConfigurationError) Error() string

type UnknownTypeError

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

func (*UnknownTypeError) Error

func (e *UnknownTypeError) Error() string

type UpCommandResult

type UpCommandResult struct {
	Outcome               string `json:"outcome"`
	ContainerID           string `json:"containerId"`
	ComposeProjectName    string `json:"composeProjectName"`
	RemoteUser            string `json:"remoteUser"`
	RemoteWorkspaceFolder string `json:"remoteWorkspaceFolder"`
}

`devcontainers up` コマンドの実行結果スキーマ

Example: {"outcome":"success","containerId":"7278c789a975c34177e0b77d00477d5518c4fae4e66e6f0f9196561d5f895740","composeProjectName":"oasiz-mqtt-client","remoteUser":"root","remoteWorkspaceFolder":"/work"}

func UnmarshalUpCommandResult

func UnmarshalUpCommandResult(data []byte) (UpCommandResult, error)

Jump to

Keyboard shortcuts

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