workspace

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleConfigFileName is the module config filename.
	ModuleConfigFileName = "dagger.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LegacyBlueprint

type LegacyBlueprint struct {
	Name   string
	Source string
	Pin    string
}

LegacyBlueprint represents a blueprint extracted from a legacy dagger.json.

func ParseLegacyBlueprint

func ParseLegacyBlueprint(data []byte) (*LegacyBlueprint, error)

ParseLegacyBlueprint parses a legacy dagger.json and extracts its blueprint. Returns nil if no blueprint is present.

type LegacyToolchain

type LegacyToolchain struct {
	Name           string
	Source         string
	Pin            string
	ConfigDefaults map[string]any
	Customizations []*modules.ModuleConfigArgument
}

LegacyToolchain represents a toolchain extracted from a legacy dagger.json, with constructor arg defaults already resolved from customizations.

func ParseLegacyToolchains

func ParseLegacyToolchains(data []byte) ([]LegacyToolchain, error)

ParseLegacyToolchains parses a legacy dagger.json and extracts its toolchains with their constructor arg defaults. Returns nil if no toolchains are present.

type PathExistsFunc

type PathExistsFunc func(ctx context.Context, path string) (parentDir string, exists bool, err error)

PathExistsFunc checks whether a filesystem path exists. Returns the canonical parent directory and whether the path exists.

type Workspace

type Workspace struct {
	// Root is the outer filesystem boundary (git root, or cwd if no git).
	Root string

	// Path is the workspace location relative to Root (e.g., "apps/frontend" or ".").
	Path string
}

Workspace represents a detected workspace boundary.

func Detect

func Detect(
	ctx context.Context,
	pathExists PathExistsFunc,
	_ func(ctx context.Context, path string) ([]byte, error),
	cwd string,
) (*Workspace, error)

Detect finds the workspace boundary from the given working directory.

Uses a 2-step fallback chain:

  1. FindUp .git → workspace root = directory containing .git
  2. No .git → cwd is workspace root

Jump to

Keyboard shortcuts

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