Documentation
¶
Index ¶
- Constants
- func CacheNamespace(p Project) string
- func EnsureCommandExists(name string) error
- func EnsureDependencies(deps []Dependency, names ...string) error
- func EnsureDependencyExists(dep Dependency) error
- func EnsureRequiredCLIExists(cli RequiredCLI) error
- func EnsureRequiredCLIs(clis []RequiredCLI, names ...string) error
- func IsServiceKind(kind Kind) bool
- func LoadDotEnv(path string) (map[string]string, error)
- func LoadOptionalDotEnv(path string) (map[string]string, error)
- func LoadOptionalDotEnvInWorktree(worktree, rel string) (map[string]string, error)
- func MergeEnvMaps(layers ...map[string]string) map[string]string
- func Names() []string
- func PreferredTarget(p Project) string
- func Register(p Project)
- func WriteFile(rt *Runtime, rel string, data []byte, mode os.FileMode) error
- type Action
- type ActionBuilder
- func (a *ActionBuilder) Alias(aliases ...string) *ActionBuilder
- func (a *ActionBuilder) Category(category ActionCategory) *ActionBuilder
- func (a *ActionBuilder) Component(component string) *ActionBuilder
- func (a *ActionBuilder) Description(description string) *ActionBuilder
- func (a *ActionBuilder) Input(input ActionInput) *ActionBuilder
- func (a *ActionBuilder) Invalidates(refs ...any) *ActionBuilder
- func (a *ActionBuilder) Kind(kind string) *ActionBuilder
- func (a *ActionBuilder) Label(label string) *ActionBuilder
- func (a *ActionBuilder) Relaunch(policy ActionRelaunchPolicy) *ActionBuilder
- func (a *ActionBuilder) RelaunchPreviousTargetAfterSuccess() *ActionBuilder
- func (a *ActionBuilder) Task(task any) *ActionBuilder
- func (a *ActionBuilder) Touches(resources ...string) *ActionBuilder
- func (a *ActionBuilder) Writes(paths ...string) *ActionBuilder
- type ActionCategory
- type ActionEffects
- type ActionInput
- type ActionInputType
- type ActionProvider
- type ActionRelaunchPolicy
- type BinaryExecSpec
- type BinaryTool
- func (t BinaryTool) BuildTask() Task
- func (t BinaryTool) Path(rt *Runtime) string
- func (t BinaryTool) Run(ctx context.Context, rt *Runtime, args ...string) error
- func (t BinaryTool) RunSpec(ctx context.Context, rt *Runtime, spec BinaryExecSpec) error
- func (t BinaryTool) Start(ctx context.Context, rt *Runtime, args ...string) (*process.Handle, error)
- func (t BinaryTool) StartSpec(ctx context.Context, rt *Runtime, spec BinaryExecSpec) (*process.Handle, error)
- type Builder
- func (b *Builder) Action(id string) *ActionBuilder
- func (b *Builder) CacheNamespace(namespace string) *Builder
- func (b *Builder) DefaultTarget(name string) *Builder
- func (b *Builder) DotEnv(paths ...string) *Builder
- func (b *Builder) Env(key, value string) *Builder
- func (b *Builder) Finalize(fn func(*api.Instance) error) *Builder
- func (b *Builder) GoDebugService(name string) *GoDebugServiceBuilder
- func (b *Builder) Group(name string, deps ...any) *TaskBuilder
- func (b *Builder) Name(name string) *Builder
- func (b *Builder) Port(name string) PortRef
- func (b *Builder) PrismaConfig(cfg PrismaConfig) *Builder
- func (b *Builder) Project() (Project, error)
- func (b *Builder) RequiredCLI(cli RequiredCLI) *Builder
- func (b *Builder) RequiredCLIs(names ...string) *Builder
- func (b *Builder) Service(name string) *TaskBuilder
- func (b *Builder) Target(name string, roots ...any) *Builder
- func (b *Builder) Task(name string) *TaskBuilder
- type CacheKeyFunc
- type CacheNamespacer
- type CommandOutputTasklet
- type ConfigureFunc
- type DebugConfig
- type DefaultTargeter
- type Dependency
- type DependencyInstallResult
- type DependencyProvider
- type DependencyStatus
- type FileContent
- type FileContentFilter
- func CombineContentFilters(filters ...FileContentFilter) FileContentFilter
- func ContentFilter(signature string, fn FileContentFilterFunc) FileContentFilter
- func GoCommentLinesStartingWith(prefixes ...string) FileContentFilter
- func GoStructDeclarations() FileContentFilter
- func LinesStartingWith(prefixes ...string) FileContentFilter
- type FileContentFilterFunc
- type FilteredInput
- type FingerprintFunc
- type GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) AllowInWatch() *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Args(args ...string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) BuildEnv(key, value string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) BuildFlags(flags ...string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) BuildOutput(path string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) ContinueOnStart(value bool) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) DebugPort(name string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) DependsOn(refs ...any) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Description(value string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) DlvCommand(command string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Env(key string, value any) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) FilteredInput(path any, filter FileContentFilter) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Ignore(patterns ...string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) InputEnv(keys ...string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Inputs(items ...any) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) ListenHost(host string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Name() string
- func (g *GoDebugServiceBuilder) Package(pkg string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Ready(fn ReadyFunc) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) ReadyFile(path string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) ReadyHTTP(portName, path string, status int) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) ReadyTCP(portName string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) ReadyTimeout(timeout time.Duration) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Ref() TaskRef
- func (g *GoDebugServiceBuilder) RequiredCLIs(names ...string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Restart(policy RestartPolicy) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) RestartAlways() *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) RestartNever() *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) RestartOnInputChange() *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) StartStopped() *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) StopGrace(grace time.Duration) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) Tags(tags ...string) *GoDebugServiceBuilder
- func (g *GoDebugServiceBuilder) WatchRestartOnServiceDeps() *GoDebugServiceBuilder
- type GoDebugServiceOptions
- type InputGlob
- type Inputs
- type InstallScript
- type InstanceConfig
- type Kind
- type Outputs
- type PortRef
- type PrismaConfig
- type PrismaConfigProvider
- type Project
- type ReadyFunc
- type RequiredCLI
- type RequiredCLIInstallResult
- type RequiredCLIProvider
- type RequiredCLIStatus
- type RestartPolicy
- type RunFunc
- type Runtime
- func (rt *Runtime) Abs(path string) string
- func (rt *Runtime) CloneEnv() map[string]string
- func (rt *Runtime) EmitJSONLine(label string, value any) error
- func (rt *Runtime) EmitLogLine(stream, line string)
- func (rt *Runtime) EnvWith(overlay map[string]string) map[string]string
- func (rt *Runtime) EventLineEmitter() func(string, string)
- func (rt *Runtime) LineEmitter() func(string, string)
- func (rt *Runtime) RegisterServiceHandle(handle ServiceHandle)
- func (rt *Runtime) RunCmd(ctx context.Context, name string, args ...string) error
- func (rt *Runtime) RunCmdSpec(ctx context.Context, spec process.CommandSpec) error
- func (rt *Runtime) StartService(ctx context.Context, name string, args ...string) (*process.Handle, error)
- func (rt *Runtime) StartServiceSpec(ctx context.Context, spec process.CommandSpec) (*process.Handle, error)
- func (rt *Runtime) WithTask(taskName, logPath string) *Runtime
- type ServiceHandle
- type Target
- type Task
- type TaskBuilder
- func (t *TaskBuilder) AllowInWatch() *TaskBuilder
- func (t *TaskBuilder) CacheKey(fn CacheKeyFunc) *TaskBuilder
- func (t *TaskBuilder) Command(name string, args ...string) *TaskBuilder
- func (t *TaskBuilder) CommandSpec(spec process.CommandSpec) *TaskBuilder
- func (t *TaskBuilder) DependsOn(refs ...any) *TaskBuilder
- func (t *TaskBuilder) Description(value string) *TaskBuilder
- func (t *TaskBuilder) Dir(dir string) *TaskBuilder
- func (t *TaskBuilder) Env(key string, value any) *TaskBuilder
- func (t *TaskBuilder) FilteredInput(path any, filter FileContentFilter) *TaskBuilder
- func (t *TaskBuilder) Fingerprint(fn FingerprintFunc) *TaskBuilder
- func (t *TaskBuilder) Ignore(patterns ...string) *TaskBuilder
- func (t *TaskBuilder) InputEnv(keys ...string) *TaskBuilder
- func (t *TaskBuilder) Inputs(items ...any) *TaskBuilder
- func (t *TaskBuilder) Name() string
- func (t *TaskBuilder) NoCache() *TaskBuilder
- func (t *TaskBuilder) OutputDirs(paths ...string) *TaskBuilder
- func (t *TaskBuilder) OutputFiles(paths ...string) *TaskBuilder
- func (t *TaskBuilder) Outputs(paths ...string) *TaskBuilder
- func (t *TaskBuilder) Ready(fn ReadyFunc) *TaskBuilder
- func (t *TaskBuilder) ReadyFile(path string) *TaskBuilder
- func (t *TaskBuilder) ReadyHTTP(portName, path string, status int) *TaskBuilder
- func (t *TaskBuilder) ReadyTCP(portName string) *TaskBuilder
- func (t *TaskBuilder) ReadyTimeout(timeout time.Duration) *TaskBuilder
- func (t *TaskBuilder) Ref() TaskRef
- func (t *TaskBuilder) RequiredCLIs(names ...string) *TaskBuilder
- func (t *TaskBuilder) Restart(policy RestartPolicy) *TaskBuilder
- func (t *TaskBuilder) RestartAlways() *TaskBuilder
- func (t *TaskBuilder) RestartNever() *TaskBuilder
- func (t *TaskBuilder) RestartOnInputChange() *TaskBuilder
- func (t *TaskBuilder) Run(fn RunFunc) *TaskBuilder
- func (t *TaskBuilder) Stamp() *TaskBuilder
- func (t *TaskBuilder) Tags(tags ...string) *TaskBuilder
- func (t *TaskBuilder) WatchRestartOnServiceDeps() *TaskBuilder
- type TaskRef
- type WorktreeDetector
Constants ¶
const ( DefaultCommandOutputMaxAttempts = 5 DefaultCommandOutputRetryDelay = 250 * time.Millisecond )
const DefaultReadyPollInterval = 100 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
func CacheNamespace ¶
func EnsureCommandExists ¶
func EnsureDependencies ¶
func EnsureDependencies(deps []Dependency, names ...string) error
func EnsureDependencyExists ¶
func EnsureDependencyExists(dep Dependency) error
func EnsureRequiredCLIExists ¶
func EnsureRequiredCLIExists(cli RequiredCLI) error
func EnsureRequiredCLIs ¶
func EnsureRequiredCLIs(clis []RequiredCLI, names ...string) error
func IsServiceKind ¶
func PreferredTarget ¶
Types ¶
type Action ¶
type Action struct {
ID string `json:"id"`
Kind string `json:"kind,omitempty"`
Category ActionCategory `json:"category,omitempty"`
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Component string `json:"component,omitempty"`
Task string `json:"task,omitempty"`
Inputs []ActionInput `json:"inputs,omitempty"`
Effects ActionEffects `json:"effects,omitempty"`
Relaunch ActionRelaunchPolicy `json:"relaunch,omitempty"`
Aliases []string `json:"aliases,omitempty"`
}
type ActionBuilder ¶
type ActionBuilder struct {
// contains filtered or unexported fields
}
func (*ActionBuilder) Alias ¶
func (a *ActionBuilder) Alias(aliases ...string) *ActionBuilder
func (*ActionBuilder) Category ¶
func (a *ActionBuilder) Category(category ActionCategory) *ActionBuilder
func (*ActionBuilder) Component ¶
func (a *ActionBuilder) Component(component string) *ActionBuilder
func (*ActionBuilder) Description ¶
func (a *ActionBuilder) Description(description string) *ActionBuilder
func (*ActionBuilder) Input ¶
func (a *ActionBuilder) Input(input ActionInput) *ActionBuilder
func (*ActionBuilder) Invalidates ¶
func (a *ActionBuilder) Invalidates(refs ...any) *ActionBuilder
func (*ActionBuilder) Kind ¶
func (a *ActionBuilder) Kind(kind string) *ActionBuilder
func (*ActionBuilder) Label ¶
func (a *ActionBuilder) Label(label string) *ActionBuilder
func (*ActionBuilder) Relaunch ¶
func (a *ActionBuilder) Relaunch(policy ActionRelaunchPolicy) *ActionBuilder
func (*ActionBuilder) RelaunchPreviousTargetAfterSuccess ¶
func (a *ActionBuilder) RelaunchPreviousTargetAfterSuccess() *ActionBuilder
func (*ActionBuilder) Task ¶
func (a *ActionBuilder) Task(task any) *ActionBuilder
func (*ActionBuilder) Touches ¶
func (a *ActionBuilder) Touches(resources ...string) *ActionBuilder
func (*ActionBuilder) Writes ¶
func (a *ActionBuilder) Writes(paths ...string) *ActionBuilder
type ActionCategory ¶
type ActionCategory string
const ( ActionCategoryAuthoring ActionCategory = "authoring" ActionCategoryOperator ActionCategory = "operator" ActionCategoryUtility ActionCategory = "utility" )
type ActionEffects ¶
type ActionInput ¶
type ActionInput struct {
Name string `json:"name"`
Type ActionInputType `json:"type"`
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Positional bool `json:"positional,omitempty"`
Env string `json:"env,omitempty"`
Default string `json:"default,omitempty"`
}
type ActionInputType ¶
type ActionInputType string
const ( ActionInputString ActionInputType = "string" ActionInputBool ActionInputType = "bool" )
type ActionProvider ¶
type ActionProvider interface {
Actions() []Action
}
type ActionRelaunchPolicy ¶
type ActionRelaunchPolicy string
const ( ActionRelaunchNever ActionRelaunchPolicy = "never" ActionRelaunchPreviousTargetAfterSuccess ActionRelaunchPolicy = "previous_target_after_success" )
type BinaryExecSpec ¶
type BinaryTool ¶
type BinaryTool struct {
TaskName string
Description string
Deps []string
Inputs Inputs
Output string
Build process.CommandSpec
Signature string
Tags []string
}
func (BinaryTool) BuildTask ¶
func (t BinaryTool) BuildTask() Task
func (BinaryTool) Path ¶
func (t BinaryTool) Path(rt *Runtime) string
func (BinaryTool) RunSpec ¶
func (t BinaryTool) RunSpec(ctx context.Context, rt *Runtime, spec BinaryExecSpec) error
func (BinaryTool) StartSpec ¶
func (t BinaryTool) StartSpec(ctx context.Context, rt *Runtime, spec BinaryExecSpec) (*process.Handle, error)
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) Action ¶
func (b *Builder) Action(id string) *ActionBuilder
func (*Builder) CacheNamespace ¶
func (*Builder) DefaultTarget ¶
func (*Builder) GoDebugService ¶
func (b *Builder) GoDebugService(name string) *GoDebugServiceBuilder
func (*Builder) PrismaConfig ¶
func (b *Builder) PrismaConfig(cfg PrismaConfig) *Builder
func (*Builder) RequiredCLI ¶
func (b *Builder) RequiredCLI(cli RequiredCLI) *Builder
func (*Builder) RequiredCLIs ¶
func (*Builder) Service ¶
func (b *Builder) Service(name string) *TaskBuilder
func (*Builder) Task ¶
func (b *Builder) Task(name string) *TaskBuilder
type CacheNamespacer ¶
type CacheNamespacer interface {
CacheNamespace() string
}
type CommandOutputTasklet ¶
type CommandOutputTasklet struct {
Command process.CommandSpec
RequiredFiles []string
OutputDirs []string
OutputHashFiles []string
CleanOutputDirs bool
RequireNewFiles bool
MaxAttempts int
RetryDelay time.Duration
}
CommandOutputTasklet runs a finite command until its required output files exist. RequiredFiles accepts worktree-relative paths and Devflow glob patterns; every entry must match at least one regular file.
A command failure is returned immediately. A successful command is retried only when its required files are still missing. CleanOutputDirs removes the explicitly listed OutputHashFiles and OutputDirs in one cleanup phase before the first attempt. RequireNewFiles makes every required path or pattern wait for a match that did not exist after that optional cleanup.
type DebugConfig ¶
type DefaultTargeter ¶
type DefaultTargeter interface {
DefaultTarget() string
}
type Dependency ¶
type Dependency = RequiredCLI
Dependency is a compatibility alias for RequiredCLI.
func DependenciesFor ¶
func DependenciesFor(p Project) []Dependency
func DependenciesForTarget ¶
func DependenciesForTarget(p Project, target string) ([]Dependency, error)
type DependencyInstallResult ¶
type DependencyInstallResult = RequiredCLIInstallResult
func InstallMissingDependencies ¶
func InstallMissingDependencies(ctx context.Context, workdir string, deps []Dependency, onLine func(string, string)) (DependencyInstallResult, error)
type DependencyProvider ¶
type DependencyProvider interface {
Dependencies() []Dependency
}
DependencyProvider is kept for compatibility with early adapters. New adapters should implement RequiredCLIProvider instead.
type DependencyStatus ¶
type DependencyStatus = RequiredCLIStatus
func CheckDependencies ¶
func CheckDependencies(deps []Dependency) []DependencyStatus
func CheckDependency ¶
func CheckDependency(dep Dependency) DependencyStatus
type FileContent ¶
type FileContentFilter ¶
type FileContentFilter struct {
Signature string `json:"signature"`
// contains filtered or unexported fields
}
func CombineContentFilters ¶
func CombineContentFilters(filters ...FileContentFilter) FileContentFilter
func ContentFilter ¶
func ContentFilter(signature string, fn FileContentFilterFunc) FileContentFilter
func GoCommentLinesStartingWith ¶
func GoCommentLinesStartingWith(prefixes ...string) FileContentFilter
func GoStructDeclarations ¶
func GoStructDeclarations() FileContentFilter
func LinesStartingWith ¶
func LinesStartingWith(prefixes ...string) FileContentFilter
func (FileContentFilter) Apply ¶
func (f FileContentFilter) Apply(ctx context.Context, rt *Runtime, file FileContent) ([]byte, error)
type FileContentFilterFunc ¶
type FilteredInput ¶
type FilteredInput struct {
Path string `json:"path"`
Filter FileContentFilter `json:"filter"`
}
func Filtered ¶
func Filtered(path any, filter FileContentFilter) FilteredInput
type GoDebugServiceBuilder ¶
type GoDebugServiceBuilder struct {
// contains filtered or unexported fields
}
func (*GoDebugServiceBuilder) AllowInWatch ¶
func (g *GoDebugServiceBuilder) AllowInWatch() *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Args ¶
func (g *GoDebugServiceBuilder) Args(args ...string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) BuildEnv ¶
func (g *GoDebugServiceBuilder) BuildEnv(key, value string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) BuildFlags ¶
func (g *GoDebugServiceBuilder) BuildFlags(flags ...string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) BuildOutput ¶
func (g *GoDebugServiceBuilder) BuildOutput(path string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) ContinueOnStart ¶
func (g *GoDebugServiceBuilder) ContinueOnStart(value bool) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) DebugPort ¶
func (g *GoDebugServiceBuilder) DebugPort(name string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) DependsOn ¶
func (g *GoDebugServiceBuilder) DependsOn(refs ...any) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Description ¶
func (g *GoDebugServiceBuilder) Description(value string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) DlvCommand ¶
func (g *GoDebugServiceBuilder) DlvCommand(command string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Env ¶
func (g *GoDebugServiceBuilder) Env(key string, value any) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) FilteredInput ¶
func (g *GoDebugServiceBuilder) FilteredInput(path any, filter FileContentFilter) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Ignore ¶
func (g *GoDebugServiceBuilder) Ignore(patterns ...string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) InputEnv ¶
func (g *GoDebugServiceBuilder) InputEnv(keys ...string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Inputs ¶
func (g *GoDebugServiceBuilder) Inputs(items ...any) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) ListenHost ¶
func (g *GoDebugServiceBuilder) ListenHost(host string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Name ¶
func (g *GoDebugServiceBuilder) Name() string
func (*GoDebugServiceBuilder) Package ¶
func (g *GoDebugServiceBuilder) Package(pkg string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Ready ¶
func (g *GoDebugServiceBuilder) Ready(fn ReadyFunc) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) ReadyFile ¶
func (g *GoDebugServiceBuilder) ReadyFile(path string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) ReadyHTTP ¶
func (g *GoDebugServiceBuilder) ReadyHTTP(portName, path string, status int) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) ReadyTCP ¶
func (g *GoDebugServiceBuilder) ReadyTCP(portName string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) ReadyTimeout ¶
func (g *GoDebugServiceBuilder) ReadyTimeout(timeout time.Duration) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Ref ¶
func (g *GoDebugServiceBuilder) Ref() TaskRef
func (*GoDebugServiceBuilder) RequiredCLIs ¶
func (g *GoDebugServiceBuilder) RequiredCLIs(names ...string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Restart ¶
func (g *GoDebugServiceBuilder) Restart(policy RestartPolicy) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) RestartAlways ¶
func (g *GoDebugServiceBuilder) RestartAlways() *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) RestartNever ¶
func (g *GoDebugServiceBuilder) RestartNever() *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) RestartOnInputChange ¶
func (g *GoDebugServiceBuilder) RestartOnInputChange() *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) StartStopped ¶
func (g *GoDebugServiceBuilder) StartStopped() *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) StopGrace ¶
func (g *GoDebugServiceBuilder) StopGrace(grace time.Duration) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) Tags ¶
func (g *GoDebugServiceBuilder) Tags(tags ...string) *GoDebugServiceBuilder
func (*GoDebugServiceBuilder) WatchRestartOnServiceDeps ¶
func (g *GoDebugServiceBuilder) WatchRestartOnServiceDeps() *GoDebugServiceBuilder
type GoDebugServiceOptions ¶
type GoDebugServiceOptions struct {
Package string
Binary string
BuildFlags []string
BuildEnv map[string]string
DlvCommand string
DebugHost string
DebugPortName string
Args []string
Env map[string]string
EnvPorts map[string]string
StartStopped bool
Ready ReadyFunc
StopGrace time.Duration
Deps []string
Inputs Inputs
RequiredCLIs []string
Restart RestartPolicy
WatchRestartOnServiceDeps bool
AllowInWatch bool
Description string
Signature string
ReadyTimeout time.Duration
Tags []string
}
type Inputs ¶
type Inputs struct {
Paths []string
Files []string
Dirs []string
Globs []string
Filtered []FilteredInput
Env []string
Ignore []string
Custom []FingerprintFunc
}
type InstallScript ¶
type InstanceConfig ¶
type PrismaConfig ¶
type PrismaConfigProvider ¶
type PrismaConfigProvider interface {
PrismaConfig() PrismaConfig
}
type Project ¶
type Project interface {
Name() string
Tasks() []Task
Targets() []Target
ConfigureInstance(ctx context.Context, worktree string) (InstanceConfig, error)
}
func Define ¶
func Define(fn ConfigureFunc) Project
type RequiredCLI ¶
type RequiredCLI struct {
Name string
Command string
Description string
Install map[string]InstallScript
}
func RequiredCLIsFor ¶
func RequiredCLIsFor(p Project) []RequiredCLI
func RequiredCLIsForTarget ¶
func RequiredCLIsForTarget(p Project, target string) ([]RequiredCLI, error)
type RequiredCLIInstallResult ¶
type RequiredCLIInstallResult struct {
Installed []string `json:"installed"`
AlreadyPresent []string `json:"alreadyPresent"`
MissingInstall []string `json:"missingInstall"`
}
func InstallMissingRequiredCLIs ¶
func InstallMissingRequiredCLIs(ctx context.Context, workdir string, clis []RequiredCLI, onLine func(string, string)) (RequiredCLIInstallResult, error)
type RequiredCLIProvider ¶
type RequiredCLIProvider interface {
RequiredCLIs() []RequiredCLI
}
type RequiredCLIStatus ¶
type RequiredCLIStatus struct {
Name string `json:"name"`
Command string `json:"command"`
Description string `json:"description,omitempty"`
Installed bool `json:"installed"`
Installable bool `json:"installable"`
Platform string `json:"platform,omitempty"`
}
func CheckRequiredCLI ¶
func CheckRequiredCLI(cli RequiredCLI) RequiredCLIStatus
func CheckRequiredCLIs ¶
func CheckRequiredCLIs(clis []RequiredCLI) []RequiredCLIStatus
type RestartPolicy ¶
type RestartPolicy string
const ( RestartNever RestartPolicy = "never" RestartOnInputChange RestartPolicy = "on_input_change" RestartAlways RestartPolicy = "always" )
type Runtime ¶
type Runtime struct {
Worktree string
Instance *api.Instance
Mode api.RunMode
Env map[string]string
TaskName string
LogPath string
EventFn func(api.Event)
// OnService is the legacy process-only registration hook. New engine
// integrations use OnServiceHandle so managed resources need no wrapper
// process.
OnService func(task string, handle *process.Handle)
OnServiceHandle func(task string, handle ServiceHandle)
DepKeys []string
OnPrompt func(task string, req process.PromptRequest) (process.PromptResponse, error)
}
func (*Runtime) EmitLogLine ¶
func (*Runtime) EventLineEmitter ¶
func (*Runtime) LineEmitter ¶
func (*Runtime) RegisterServiceHandle ¶
func (rt *Runtime) RegisterServiceHandle(handle ServiceHandle)
RegisterServiceHandle registers a supervised service with the engine. StartServiceSpec calls it automatically; managed-resource integrations use it directly. The handle must implement idempotent Stop.
func (*Runtime) RunCmdSpec ¶
func (*Runtime) StartService ¶
func (*Runtime) StartServiceSpec ¶
type ServiceHandle ¶
ServiceHandle is the lifecycle boundary for supervised services. Normal command services use *process.Handle; integrations such as managed containers can implement the same contract without spawning a wrapper CLI.
type Task ¶
type Task struct {
Name string
Kind Kind
// Deps are task graph dependencies that must run before this task.
Deps []string
// RequiredCLIs names entries from the project RequiredCLIs catalog.
// They are external command prerequisites, not task graph edges.
RequiredCLIs []string
Inputs Inputs
Outputs Outputs
Run RunFunc
Ready ReadyFunc
ReadyTimeout time.Duration
Cache bool
Stamp bool
Restart RestartPolicy
WatchRestartOnServiceDeps bool
AllowInWatch bool
Tags []string
Description string
Signature string
CacheKeyOverride CacheKeyFunc
Debug *DebugConfig
}
func GoDebugService ¶
func GoDebugService(name string, opts GoDebugServiceOptions) Task
type TaskBuilder ¶
type TaskBuilder struct {
// contains filtered or unexported fields
}
func (*TaskBuilder) AllowInWatch ¶
func (t *TaskBuilder) AllowInWatch() *TaskBuilder
func (*TaskBuilder) CacheKey ¶
func (t *TaskBuilder) CacheKey(fn CacheKeyFunc) *TaskBuilder
func (*TaskBuilder) Command ¶
func (t *TaskBuilder) Command(name string, args ...string) *TaskBuilder
func (*TaskBuilder) CommandSpec ¶
func (t *TaskBuilder) CommandSpec(spec process.CommandSpec) *TaskBuilder
func (*TaskBuilder) DependsOn ¶
func (t *TaskBuilder) DependsOn(refs ...any) *TaskBuilder
func (*TaskBuilder) Description ¶
func (t *TaskBuilder) Description(value string) *TaskBuilder
func (*TaskBuilder) Dir ¶
func (t *TaskBuilder) Dir(dir string) *TaskBuilder
func (*TaskBuilder) Env ¶
func (t *TaskBuilder) Env(key string, value any) *TaskBuilder
func (*TaskBuilder) FilteredInput ¶
func (t *TaskBuilder) FilteredInput(path any, filter FileContentFilter) *TaskBuilder
func (*TaskBuilder) Fingerprint ¶
func (t *TaskBuilder) Fingerprint(fn FingerprintFunc) *TaskBuilder
func (*TaskBuilder) Ignore ¶
func (t *TaskBuilder) Ignore(patterns ...string) *TaskBuilder
func (*TaskBuilder) InputEnv ¶
func (t *TaskBuilder) InputEnv(keys ...string) *TaskBuilder
func (*TaskBuilder) Inputs ¶
func (t *TaskBuilder) Inputs(items ...any) *TaskBuilder
func (*TaskBuilder) Name ¶
func (t *TaskBuilder) Name() string
func (*TaskBuilder) NoCache ¶
func (t *TaskBuilder) NoCache() *TaskBuilder
func (*TaskBuilder) OutputDirs ¶
func (t *TaskBuilder) OutputDirs(paths ...string) *TaskBuilder
func (*TaskBuilder) OutputFiles ¶
func (t *TaskBuilder) OutputFiles(paths ...string) *TaskBuilder
func (*TaskBuilder) Outputs ¶
func (t *TaskBuilder) Outputs(paths ...string) *TaskBuilder
func (*TaskBuilder) Ready ¶
func (t *TaskBuilder) Ready(fn ReadyFunc) *TaskBuilder
func (*TaskBuilder) ReadyFile ¶
func (t *TaskBuilder) ReadyFile(path string) *TaskBuilder
func (*TaskBuilder) ReadyHTTP ¶
func (t *TaskBuilder) ReadyHTTP(portName, path string, status int) *TaskBuilder
func (*TaskBuilder) ReadyTCP ¶
func (t *TaskBuilder) ReadyTCP(portName string) *TaskBuilder
func (*TaskBuilder) ReadyTimeout ¶
func (t *TaskBuilder) ReadyTimeout(timeout time.Duration) *TaskBuilder
func (*TaskBuilder) Ref ¶
func (t *TaskBuilder) Ref() TaskRef
func (*TaskBuilder) RequiredCLIs ¶
func (t *TaskBuilder) RequiredCLIs(names ...string) *TaskBuilder
func (*TaskBuilder) Restart ¶
func (t *TaskBuilder) Restart(policy RestartPolicy) *TaskBuilder
func (*TaskBuilder) RestartAlways ¶
func (t *TaskBuilder) RestartAlways() *TaskBuilder
func (*TaskBuilder) RestartNever ¶
func (t *TaskBuilder) RestartNever() *TaskBuilder
func (*TaskBuilder) RestartOnInputChange ¶
func (t *TaskBuilder) RestartOnInputChange() *TaskBuilder
func (*TaskBuilder) Run ¶
func (t *TaskBuilder) Run(fn RunFunc) *TaskBuilder
func (*TaskBuilder) Stamp ¶
func (t *TaskBuilder) Stamp() *TaskBuilder
func (*TaskBuilder) Tags ¶
func (t *TaskBuilder) Tags(tags ...string) *TaskBuilder
func (*TaskBuilder) WatchRestartOnServiceDeps ¶
func (t *TaskBuilder) WatchRestartOnServiceDeps() *TaskBuilder