Documentation
¶
Overview ¶
Package projects provides utilities for managing Docker Compose projects and their metadata.
Index ¶
- Constants
- Variables
- func ComposeDown(ctx context.Context, proj *types.Project, removeVolumes bool) error
- func ComposeLogs(ctx context.Context, projectName string, out io.Writer, follow bool, ...) error
- func ComposePs(ctx context.Context, proj *types.Project, services []string, all bool) ([]api.ContainerSummary, error)
- func ComposeRestart(ctx context.Context, proj *types.Project, services []string) error
- func ComposeUp(ctx context.Context, proj *types.Project, services []string, ...) error
- func DetectComposeFile(dir string) (string, error)
- func ListGlobalComposeContainers(ctx context.Context) ([]container.Summary, error)
- func LoadComposeProject(ctx context.Context, composeFile, projectName, projectsDirectory string, ...) (*composetypes.Project, error)
- func LoadComposeProjectFromDir(ctx context.Context, dir, projectName, projectsDirectory string, ...) (*composetypes.Project, string, error)
- func ValidateIncludePathForWrite(projectDir, includePath string) (string, error)
- func WriteIncludeFile(projectDir, includePath, content string) error
- type ArcaneComposeMetadata
- type Client
- type EnvLoader
- type EnvMap
- type IncludeFile
- type ProgressWriterKey
Constants ¶
const (
// ArcaneIconLabel is the full reverse-DNS label key for service-level icons.
ArcaneIconLabel = "com.getarcaneapp.arcane.icon"
)
Variables ¶
var ComposeFileCandidates = []string{
"compose.yaml",
"compose.yml",
"docker-compose.yaml",
"docker-compose.yml",
}
Functions ¶
func ComposeDown ¶
func ComposeLogs ¶
func ComposeRestart ¶
func DetectComposeFile ¶
func LoadComposeProject ¶
func LoadComposeProject(ctx context.Context, composeFile, projectName, projectsDirectory string, autoInjectEnv bool, pathMapper *pathmapper.PathMapper) (*composetypes.Project, error)
func LoadComposeProjectFromDir ¶
func LoadComposeProjectFromDir(ctx context.Context, dir, projectName, projectsDirectory string, autoInjectEnv bool, pathMapper *pathmapper.PathMapper) (*composetypes.Project, string, error)
func ValidateIncludePathForWrite ¶
ValidateIncludePathForWrite ensures the include path is safe for write operations Returns the validated absolute path to prevent recomputation after validation Only allows writing within the project directory
func WriteIncludeFile ¶
WriteIncludeFile writes content to an include file path
Types ¶
type ArcaneComposeMetadata ¶
type ArcaneComposeMetadata struct {
// ProjectIconURL is the URL to an icon representing the entire project.
ProjectIconURL string
// ProjectURLS are additional URLs related to the project (e.g., documentation, homepage).
ProjectURLS []string
// ServiceIcons maps service names to their respective icon identifiers or URLs.
ServiceIcons map[string]string
}
ArcaneComposeMetadata represents Arcane-specific configuration extracted from a Compose file.
func ParseArcaneComposeMetadata ¶
func ParseArcaneComposeMetadata(ctx context.Context, composeFilePath string) (ArcaneComposeMetadata, error)
ParseArcaneComposeMetadata reads a Docker Compose file and extracts Arcane-specific metadata.
func ParseArcaneComposeMetadataWithEnv ¶
func ParseArcaneComposeMetadataWithEnv(ctx context.Context, composeFilePath string, envMap map[string]string) (ArcaneComposeMetadata, error)
ParseArcaneComposeMetadataWithEnv reads a Docker Compose file and extracts Arcane-specific metadata using a provided environment.
type EnvLoader ¶
type EnvLoader struct {
// contains filtered or unexported fields
}
func NewEnvLoader ¶
func (*EnvLoader) LoadEnvironment ¶
func (l *EnvLoader) LoadEnvironment(ctx context.Context) (envMap EnvMap, injectionVars EnvMap, err error)
LoadEnvironment loads and merges environment variables from all sources: 1. Process environment 2. Global .env.global file (from projects directory) 3. Project-specific .env file (from workdir)
type IncludeFile ¶
type IncludeFile struct {
Path string `json:"path"`
RelativePath string `json:"relative_path"`
Content string `json:"content"`
}
func ParseIncludes ¶
func ParseIncludes(composeFilePath string) ([]IncludeFile, error)
ParseIncludes reads a compose file and extracts all include directives
type ProgressWriterKey ¶
type ProgressWriterKey struct{}
ProgressWriterKey can be set on a context to enable JSON-line progress updates. The value must be an io.Writer (typically the HTTP response writer).