Documentation
¶
Index ¶
- Constants
- func AddWorkspace(w config.Workspace, cfg *config.Config) error
- func CollectPackages(profiles []string) []string
- func CopyWorkspaceCredentials(srcWorkspace, dstWorkspace string, agents []string) error
- func CustomSnippet(name string) string
- func DockerfileSnippet(name string) string
- func EnsureAgentConfig(workspaceName, agent string) error
- func Exists(name string) bool
- func FindWorkspace(cfg *config.Config, name string) *config.Workspace
- func Packages(name string) string
- func RemoveWorkspace(name string, cfg *config.Config) error
- func SetActiveWorkspace(name string, cfg *config.Config) error
- func WorkspaceAgentDir(workspaceName, agent string) string
- func WorkspaceNames(cfg *config.Config) []string
- type InvalidWorkspaceError
- type Profile
- type ResolvedWorkspace
Constants ¶
const ( ScopeGlobal = "global" ScopeDirectory = "directory" )
Variables ¶
This section is empty.
Functions ¶
func AddWorkspace ¶ added in v0.1.1
AddWorkspace adds a workspace to the global config. If dir is non-empty, it becomes a directory-scoped workspace.
func CollectPackages ¶ added in v0.1.5
CollectPackages returns a deduplicated list of all Alpine packages needed by the given profiles.
func CopyWorkspaceCredentials ¶ added in v0.1.3
CopyWorkspaceCredentials copies all agent credentials from one workspace to another. Only copies agents whose source directory exists and is non-empty.
func CustomSnippet ¶ added in v0.1.5
CustomSnippet returns the non-apk Dockerfile instructions for a profile (e.g. Go download, Python venv, Flutter install, node npm globals). Returns empty string if the profile only needs apk packages.
func DockerfileSnippet ¶
DockerfileSnippet returns the full Dockerfile instructions for a profile. Deprecated: use CollectPackages + CustomSnippet for batched apk installs.
func EnsureAgentConfig ¶ added in v0.1.1
EnsureAgentConfig ensures agent config directories exist for active workspace.
func FindWorkspace ¶ added in v0.1.3
FindWorkspace returns a workspace by name (case-insensitive), or nil.
func Packages ¶ added in v0.1.5
Packages returns the space-separated Alpine packages for a profile, or empty string if the profile has none or only custom install steps.
func RemoveWorkspace ¶ added in v0.1.1
RemoveWorkspace removes a workspace from the global config.
func SetActiveWorkspace ¶ added in v0.1.1
SetActiveWorkspace sets the active workspace in the global config. This only changes the current session's active workspace, NOT the default workspace. The default is only changed via the setup wizard or explicit CLI commands (e.g. `exitbox workspaces default <name>`).
func WorkspaceAgentDir ¶ added in v0.1.1
WorkspaceAgentDir returns host path for workspace agent config.
func WorkspaceNames ¶ added in v0.1.3
WorkspaceNames returns the names of all configured workspaces.
Types ¶
type InvalidWorkspaceError ¶ added in v0.1.1
type InvalidWorkspaceError struct {
Name string
}
InvalidWorkspaceError is returned when an invalid development profile is used.
func (*InvalidWorkspaceError) Error ¶ added in v0.1.1
func (e *InvalidWorkspaceError) Error() string
type Profile ¶
type Profile struct {
Name string
Description string
Packages string // Space-separated Alpine packages
}
Profile defines a development profile with its packages and description.
type ResolvedWorkspace ¶ added in v0.1.1
ResolvedWorkspace wraps a workspace with its source scope.
func ListWorkspaces ¶ added in v0.1.1
func ListWorkspaces(cfg *config.Config) []ResolvedWorkspace
ListWorkspaces returns all workspaces from the global config.
func ResolveActiveWorkspace ¶ added in v0.1.1
func ResolveActiveWorkspace(cfg *config.Config, projectDir string, overrideName string) (*ResolvedWorkspace, error)
ResolveActiveWorkspace resolves the workspace used for this run. Resolution order:
- overrideName (from --workspace flag)
- Directory-scoped workspace matching projectDir
- cfg.Settings.DefaultWorkspace
- cfg.Workspaces.Active
- First workspace in list