Documentation
¶
Index ¶
- Constants
- func ExtractConfigDefaults(customizations []*modules.ModuleConfigArgument) map[string]any
- type LegacyBlueprint
- type LegacyToolchain
- type Lock
- func (l *Lock) Clone() (*Lock, error)
- func (l *Lock) DeleteLookup(namespace, operation string, inputs []any) bool
- func (l *Lock) Entries() ([]LookupEntry, error)
- func (l *Lock) GetLookup(namespace, operation string, inputs []any) (LookupResult, bool, error)
- func (l *Lock) GetModuleResolve(source string) (LookupResult, bool, error)
- func (l *Lock) Marshal() ([]byte, error)
- func (l *Lock) Merge(other *Lock) error
- func (l *Lock) SetLookup(namespace, operation string, inputs []any, result LookupResult) error
- func (l *Lock) SetModuleResolve(source string, result LookupResult) error
- type LockMode
- type LockPolicy
- type LookupEntry
- type LookupResult
- type PathExistsFunc
- type Workspace
Constants ¶
const ( LockDirName = ".dagger" LockFileName = "lock" )
const ( LockModeDisabled LockMode = "disabled" LockModeLive LockMode = "live" LockModePinned LockMode = "pinned" LockModeFrozen LockMode = "frozen" // Backward-compatible aliases for the previous experimental names. LockModeAuto = LockModePinned LockModeStrict = LockModeFrozen // DefaultLockMode is used when no mode is explicitly set. DefaultLockMode = LockModeDisabled )
const (
// ModuleConfigFileName is the module config filename.
ModuleConfigFileName = "dagger.json"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractConfigDefaults ¶ added in v0.21.0
func ExtractConfigDefaults(customizations []*modules.ModuleConfigArgument) map[string]any
ExtractConfigDefaults returns constructor arg defaults from customizations.
Types ¶
type LegacyBlueprint ¶
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 Lock ¶ added in v0.21.0
type Lock struct {
// contains filtered or unexported fields
}
Lock is the workspace lockfile wrapper.
func (*Lock) DeleteLookup ¶ added in v0.21.0
DeleteLookup removes a generic lookup tuple entry.
func (*Lock) Entries ¶ added in v0.21.0
func (l *Lock) Entries() ([]LookupEntry, error)
Entries returns a deterministic snapshot of all lookup entries.
func (*Lock) GetLookup ¶ added in v0.21.0
GetLookup retrieves the lock result for a generic lookup tuple.
func (*Lock) GetModuleResolve ¶ added in v0.21.0
func (l *Lock) GetModuleResolve(source string) (LookupResult, bool, error)
GetModuleResolve retrieves the lock result for a module source lookup.
func (*Lock) SetLookup ¶ added in v0.21.0
func (l *Lock) SetLookup(namespace, operation string, inputs []any, result LookupResult) error
SetLookup sets the lock result for a generic lookup tuple.
func (*Lock) SetModuleResolve ¶ added in v0.21.0
func (l *Lock) SetModuleResolve(source string, result LookupResult) error
SetModuleResolve sets the lock result for a module source lookup.
type LockMode ¶ added in v0.21.0
type LockMode string
LockMode controls where lookup results come from for a run.
func ParseLockMode ¶ added in v0.21.0
ParseLockMode validates an explicitly configured lock mode.
func ResolveLockMode ¶ added in v0.21.0
ResolveLockMode applies the branch default when the mode is unspecified.
type LockPolicy ¶ added in v0.21.0
type LockPolicy string
LockPolicy controls update intent for a lock entry.
const ( PolicyPin LockPolicy = "pin" PolicyFloat LockPolicy = "float" )
type LookupEntry ¶ added in v0.21.0
type LookupEntry struct {
Namespace string
Operation string
Inputs []any
Result LookupResult
}
LookupEntry is a structured lockfile lookup tuple.
type LookupResult ¶ added in v0.21.0
type LookupResult struct {
Value string `json:"value"`
Policy LockPolicy `json:"policy"`
}
LookupResult is the stored lock result for a lookup tuple.
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:
- FindUp .git → workspace root = directory containing .git
- No .git → cwd is workspace root