devenv

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(
	dockerClient *client.Client,
	stream proto.Agent_BuildAndStartDevEnvServer,
	userConfigRepoOwner string,
	userConfigRepoName string,
	repoOwner string,
	repoName string,
	preparedWorkspaceMetadata *PreparedWorkspaceMetadata,
) error

func EnsureDockerContainerRemoved

func EnsureDockerContainerRemoved(dockerClient *client.Client) error

func EnsureDockerContainerRunning

func EnsureDockerContainerRunning(
	dockerClient *client.Client,
) error

func RunWorkspaceHooks

func RunWorkspaceHooks(
	dockerClient *client.Client,
	stream proto.Agent_BuildAndStartDevEnvServer,
	workspaceConfig *WorkspaceConfig,
) error

func SaveWorkspaceConfigAsFile

func SaveWorkspaceConfigAsFile(
	workspaceConfigFilePath string,
	workspaceConfig *WorkspaceConfig,
) error

Types

type GRPCBuildAndStartDevEnvStreamWriter

type GRPCBuildAndStartDevEnvStreamWriter struct {
	Stream proto.Agent_BuildAndStartDevEnvServer
}

func (GRPCBuildAndStartDevEnvStreamWriter) Write

type PreparedWorkspaceMetadata

type PreparedWorkspaceMetadata struct {
	TmpUserConfigRepoDirPath    string
	TmpDevEnvRepoDirPath        string
	TmpDevEnvRepoConfigDirPath  string
	TmpDevEnvRepoDockerfilePath string
	DevEnvRepoHasDockerfile     bool
}

func PrepareWorkspace

func PrepareWorkspace(
	userConfigRepoOwner string,
	userConfigRepoName string,
	devEnvRepoOwner string,
	devEnvRepoName string,
	workspaceConfig *WorkspaceConfig,
) (*PreparedWorkspaceMetadata, error)

type VSCodeWorkspaceConfig

type VSCodeWorkspaceConfig struct {
	Folders    []VSCodeWorkspaceConfigFolder   `json:"folders"`
	Settings   map[string]interface{}          `json:"settings"`
	Extensions VSCodeWorkspaceConfigExtensions `json:"extensions"`
}

VSCodeWorkspaceConfig matches .code-workspace schema. See: https://code.visualstudio.com/docs/editor/multi-root-workspaces#_workspace-file-schema

func LoadVSCodeWorkspaceConfig

func LoadVSCodeWorkspaceConfig(
	vscodeWorkspaceConfigFilePath string,
) (*VSCodeWorkspaceConfig, error)

type VSCodeWorkspaceConfigExtensions

type VSCodeWorkspaceConfigExtensions struct {
	Recommendations []string `json:"recommendations"`
}

type VSCodeWorkspaceConfigFolder

type VSCodeWorkspaceConfigFolder struct {
	Path string `json:"path"`
}

type WorkspaceConfig

type WorkspaceConfig struct {
	Repositories []WorkspaceConfigRepository `json:"repositories"`
}

func LoadWorkspaceConfig

func LoadWorkspaceConfig(
	workspaceConfigFilePath string,
) (*WorkspaceConfig, error)

func NewWorkspaceConfig

func NewWorkspaceConfig() *WorkspaceConfig

type WorkspaceConfigRepository

type WorkspaceConfigRepository struct {
	Owner         string                          `json:"owner"`
	Name          string                          `json:"name"`
	RootDirPath   string                          `json:"root_dir_path"`
	ConfigDirPath string                          `json:"config_dir_path"`
	Hooks         []WorkspaceConfigRepositoryHook `json:"hooks"`
	IsDevEnvRepo  bool                            `json:"is_main"`
}

type WorkspaceConfigRepositoryHook

type WorkspaceConfigRepositoryHook struct {
	ScriptFilePath       string `json:"script_file_path"`
	ScriptWorkingDirPath string `json:"script_working_dir_path"`
}

Jump to

Keyboard shortcuts

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