projects

package
v0.0.0-...-89c7248 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ComposeFileCandidates = []string{
	"compose.yaml",
	"compose.yml",
	"docker-compose.yaml",
	"docker-compose.yml",
}

Functions

func ComposeDown

func ComposeDown(ctx context.Context, proj *types.Project, removeVolumes bool) error

func ComposeLogs

func ComposeLogs(ctx context.Context, projectName string, out io.Writer, follow bool, tail string) error

func ComposePs

func ComposePs(ctx context.Context, proj *types.Project, services []string, all bool) ([]api.ContainerSummary, error)

func ComposeRestart

func ComposeRestart(ctx context.Context, proj *types.Project, services []string) error

func ComposeUp

func ComposeUp(ctx context.Context, proj *types.Project, services []string, removeOrphans bool) error

func DetectComposeFile

func DetectComposeFile(dir string) (string, error)

func ListGlobalComposeContainers

func ListGlobalComposeContainers(ctx context.Context) ([]container.Summary, error)

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

func ValidateIncludePathForWrite(projectDir, includePath string) (string, error)

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

func WriteIncludeFile(projectDir, includePath, content string) error

WriteIncludeFile writes content to an include file path

Types

type Client

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

func NewClient

func NewClient(ctx context.Context) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

type EnvLoader

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

func NewEnvLoader

func NewEnvLoader(projectsDir, workdir string, autoInjectEnv bool) *EnvLoader

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 EnvMap

type EnvMap map[string]string

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).

Jump to

Keyboard shortcuts

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