profile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeGlobal    = "global"
	ScopeDirectory = "directory"
)

Variables

This section is empty.

Functions

func AddWorkspace added in v0.1.1

func AddWorkspace(w config.Workspace, cfg *config.Config) error

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

func CollectPackages(profiles []string) []string

CollectPackages returns a deduplicated list of all Alpine packages needed by the given profiles.

func CopyWorkspaceCredentials added in v0.1.3

func CopyWorkspaceCredentials(srcWorkspace, dstWorkspace string, agents []string) error

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

func CustomSnippet(name string) string

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

func DockerfileSnippet(name string) string

DockerfileSnippet returns the full Dockerfile instructions for a profile. Deprecated: use CollectPackages + CustomSnippet for batched apk installs.

func EnsureAgentConfig added in v0.1.1

func EnsureAgentConfig(workspaceName, agent string) error

EnsureAgentConfig ensures agent config directories exist for active workspace.

func Exists

func Exists(name string) bool

Exists returns true if the profile name is valid.

func FindWorkspace added in v0.1.3

func FindWorkspace(cfg *config.Config, name string) *config.Workspace

FindWorkspace returns a workspace by name (case-insensitive), or nil.

func Packages added in v0.1.5

func Packages(name string) string

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

func RemoveWorkspace(name string, cfg *config.Config) error

RemoveWorkspace removes a workspace from the global config.

func SetActiveWorkspace added in v0.1.1

func SetActiveWorkspace(name string, cfg *config.Config) error

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

func WorkspaceAgentDir(workspaceName, agent string) string

WorkspaceAgentDir returns host path for workspace agent config.

func WorkspaceNames added in v0.1.3

func WorkspaceNames(cfg *config.Config) []string

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.

func All

func All() []Profile

All returns all available profiles.

func Get

func Get(name string) *Profile

Get returns a profile by name, or nil if not found.

type ResolvedWorkspace added in v0.1.1

type ResolvedWorkspace struct {
	Scope     string
	Workspace config.Workspace
}

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:

  1. overrideName (from --workspace flag)
  2. Directory-scoped workspace matching projectDir
  3. cfg.Settings.DefaultWorkspace
  4. cfg.Workspaces.Active
  5. First workspace in list

Jump to

Keyboard shortcuts

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