docker

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 37 Imported by: 7

Documentation

Index

Constants

View Source
const ContainerNotFoundMetadata = "{\"state\": \"container not found\"}"
View Source
const UPDATE_UID_GID_SCRIPT = `` /* 1140-byte string literal not displayed */
View Source
const WorkspaceMetadataFormat = "{\"networkId\": \"%s\"}"

Variables

This section is empty.

Functions

func GetContainerCreateConfig

func GetContainerCreateConfig(project *workspace.Project) *container.Config

Types

type CreateProjectOptions added in v0.21.0

type CreateProjectOptions struct {
	Project    *workspace.Project
	ProjectDir string
	Cr         *containerregistry.ContainerRegistry
	LogWriter  io.Writer
	Gpc        *gitprovider.GitProviderConfig
	SshClient  *ssh.Client
}

type DevcontainerPaths added in v0.22.0

type DevcontainerPaths struct {
	OverridesDir         string
	OverridesTarget      string
	ProjectTarget        string
	TargetConfigFilePath string
}

type DockerClient

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

func (*DockerClient) CreateProject

func (d *DockerClient) CreateProject(opts *CreateProjectOptions) error

func (*DockerClient) CreateWorkspace

func (d *DockerClient) CreateWorkspace(workspace *workspace.Workspace, workspaceDir string, logWriter io.Writer, sshClient *ssh.Client) error

func (*DockerClient) DestroyProject

func (d *DockerClient) DestroyProject(project *workspace.Project, projectDir string, sshClient *ssh.Client) error

func (*DockerClient) DestroyWorkspace

func (d *DockerClient) DestroyWorkspace(workspace *workspace.Workspace, workspaceDir string, sshClient *ssh.Client) error

func (*DockerClient) ExecSync

func (d *DockerClient) ExecSync(containerID string, config types.ExecConfig, outputWriter io.Writer) (*ExecResult, error)

func (*DockerClient) GetContainerLogs

func (d *DockerClient) GetContainerLogs(containerName string, logWriter io.Writer) error

func (*DockerClient) GetProjectContainerName

func (d *DockerClient) GetProjectContainerName(project *workspace.Project) string

func (*DockerClient) GetProjectInfo

func (d *DockerClient) GetProjectInfo(project *workspace.Project) (*workspace.ProjectInfo, error)

func (*DockerClient) GetProjectVolumeName added in v0.17.0

func (d *DockerClient) GetProjectVolumeName(project *workspace.Project) string

func (*DockerClient) GetWorkspaceInfo

func (d *DockerClient) GetWorkspaceInfo(ws *workspace.Workspace) (*workspace.WorkspaceInfo, error)

func (*DockerClient) PullImage added in v0.17.0

func (d *DockerClient) PullImage(imageName string, cr *containerregistry.ContainerRegistry, logWriter io.Writer) error

func (*DockerClient) PushImage added in v0.17.0

func (d *DockerClient) PushImage(imageName string, cr *containerregistry.ContainerRegistry, logWriter io.Writer) error

func (*DockerClient) StartProject

func (d *DockerClient) StartProject(opts *CreateProjectOptions, daytonaDownloadUrl string) error

func (*DockerClient) StopProject

func (d *DockerClient) StopProject(project *workspace.Project, logWriter io.Writer) error

type DockerClientConfig

type DockerClientConfig struct {
	ApiClient client.APIClient
}

type ExecResult

type ExecResult struct {
	StdOut   string
	StdErr   string
	ExitCode int
}

type IDockerClient

type IDockerClient interface {
	CreateProject(opts *CreateProjectOptions) error
	CreateWorkspace(workspace *workspace.Workspace, workspaceDir string, logWriter io.Writer, sshClient *ssh.Client) error

	DestroyProject(project *workspace.Project, projectDir string, sshClient *ssh.Client) error
	DestroyWorkspace(workspace *workspace.Workspace, workspaceDir string, sshClient *ssh.Client) error

	StartProject(opts *CreateProjectOptions, daytonaDownloadUrl string) error
	StopProject(project *workspace.Project, logWriter io.Writer) error

	GetProjectInfo(project *workspace.Project) (*workspace.ProjectInfo, error)
	GetWorkspaceInfo(ws *workspace.Workspace) (*workspace.WorkspaceInfo, error)

	GetProjectContainerName(project *workspace.Project) string
	GetProjectVolumeName(project *workspace.Project) string
	ExecSync(containerID string, config types.ExecConfig, outputWriter io.Writer) (*ExecResult, error)
	GetContainerLogs(containerName string, logWriter io.Writer) error
	PullImage(imageName string, cr *containerregistry.ContainerRegistry, logWriter io.Writer) error
	PushImage(imageName string, cr *containerregistry.ContainerRegistry, logWriter io.Writer) error
}

func NewDockerClient

func NewDockerClient(config DockerClientConfig) IDockerClient

type RemoteUser added in v0.21.0

type RemoteUser string

Jump to

Keyboard shortcuts

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