devcontainers

package
v0.1.21758829476 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyTemplateToFolder added in v0.1.858116614

func CopyTemplateToFolder(templatePath string, targetFolder string, devcontainerName string) error

func ExecInDevContainer added in v0.1.816111590

func ExecInDevContainer(containerID string, workDir string, args []string) error

func FindDevContainerInAncestorPaths added in v0.1.21758829476

func FindDevContainerInAncestorPaths(folderPath string) (string, error)

func GetDefaultDevcontainerNameForFolder added in v0.1.259948365

func GetDefaultDevcontainerNameForFolder(folderPath string) (string, error)

func GetDevContainerURI added in v0.1.158565981

func GetDevContainerURI(folderPath string, subFolder string) (string, error)

GetDevContainerURI gets the devcontainer URI for a folder to launch using the VS Code --folder-uri switch If subFolder is specified, it is appended to the workspaceMountPath

func GetDevContainerUserName added in v0.1.310713546

func GetDevContainerUserName(devContainerJsonPath string) (string, error)

"remoteUser": "vscode"

func GetLocalFolderFromDevContainer added in v0.1.163415964

func GetLocalFolderFromDevContainer(containerIDOrName string) (string, error)

GetLocalFolderFromDevContainer looks up the local (host) folder name from the container labels

func GetWorkspaceMountPath added in v0.1.163415964

func GetWorkspaceMountPath(folderPath string) (string, error)

GetWorkspaceMountPath returns the devcontainer mount path for the devcontainer in the specified folder

func SetDevcontainerName added in v0.1.259948365

func SetDevcontainerName(devContainerJsonPath string, name string) error

Types

type DevcontainerInfo

type DevcontainerInfo struct {
	ContainerID      string `json:"containerID"`
	ContainerName    string `json:"containerName"`
	DevcontainerName string `json:"devcontainerName"`
	FolderPath       string `json:"folderPath"`
	LocalFolderPath  string `json:"localFolderPath"`
}

DevcontainerInfo holds details about a devcontainer

func GetClosestPathMatchForPath added in v0.1.901789955

func GetClosestPathMatchForPath(devContainers []DevcontainerInfo, devcontainerPath string) (DevcontainerInfo, error)

GetClosestPathMatchForPath returns the dev container with the closes match to the specified path

func ListDevcontainers

func ListDevcontainers() ([]DevcontainerInfo, error)

ListDevcontainers returns a list of devcontainers

type DevcontainerTemplate added in v0.1.114116943

type DevcontainerTemplate struct {
	Name string
	// Path is the path including the .devcontainer folder
	Path string
}

DevcontainerTemplate holds info on templates for list/add etc

func GetTemplateByName added in v0.1.114116943

func GetTemplateByName(name string) (*DevcontainerTemplate, error)

GetTemplateByName returns the template with the specified name or nil if not found

func GetTemplates added in v0.1.114116943

func GetTemplates() ([]DevcontainerTemplate, error)

GetTemplates returns a list of discovered templates

type DockerMount added in v0.1.901789955

type DockerMount struct {
	Source      string `json:"Source"`
	Destination string `json:"Destination"`
}

DockerMount represents mount info from Docker output

type SourceInfo added in v0.1.968022249

type SourceInfo struct {
	DevcontainerFolder string
	DockerMount        DockerMount
}

SourceInfo holds properties about the source mounted in a dev container

func GetSourceInfoFromDevContainer added in v0.1.968022249

func GetSourceInfoFromDevContainer(containerIDOrName string) (SourceInfo, error)

GetSourceInfoFromDevContainer inspects the specified container and returns the SourceInfo

type SubstitutionValues added in v0.1.861633436

type SubstitutionValues struct {
	Name       string
	UserName   string
	HomeFolder string
}

Jump to

Keyboard shortcuts

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