Documentation
¶
Index ¶
- type Config
- type DefaultScheduler
- type EventSink
- type Executor
- type ExecutorOption
- type GroupResult
- type JobResult
- type JobRunner
- type JobStatus
- type PlanMode
- type Result
- type Scheduler
- type WorkerPool
- type Workspace
- func (w Workspace) ModuleDir(rel string) string
- func (w Workspace) PlanFile(rel string) string
- func (w Workspace) PlanJSONFile(rel string) string
- func (w Workspace) PlanTextFile(rel string) string
- func (w Workspace) ServiceDir() string
- func (w Workspace) ServiceFile(name string) string
- func (w Workspace) WorkDir() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Binary string
InitEnabled bool
PlanEnabled bool
PlanMode PlanMode
Parallelism int
Env map[string]string
}
Config is the normalized execution configuration shared by CI generation and local execution.
func ConfigFromProject ¶
ConfigFromProject normalizes execution config from a project config snapshot.
func (Config) BuildRequirements ¶ added in v0.10.3
func (c Config) BuildRequirements() pipeline.BuildRequirements
BuildRequirements converts execution-mode choices into pipeline IR requirements. Provider plugins should only add provider/config requirements; runtime execution requirements are derived here.
type DefaultScheduler ¶
type DefaultScheduler struct{}
DefaultScheduler schedules jobs from the pipeline DAG.
type EventSink ¶
type EventSink interface {
JobStarted(job *pipeline.Job)
JobFinished(job *pipeline.Job, result *JobResult)
}
EventSink consumes structured execution events.
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes a Plan.
func NewExecutor ¶
func NewExecutor(runner JobRunner, opts ...ExecutorOption) *Executor
NewExecutor constructs an Executor.
type ExecutorOption ¶
type ExecutorOption func(*Executor)
ExecutorOption mutates executor behavior.
func WithEventSink ¶
func WithEventSink(sink EventSink) ExecutorOption
WithEventSink configures an execution event sink.
func WithParallelism ¶
func WithParallelism(parallelism int) ExecutorOption
WithParallelism bounds concurrent jobs inside one execution group.
func WithScheduler ¶
func WithScheduler(s Scheduler) ExecutorOption
WithScheduler overrides the execution scheduler.
type GroupResult ¶
GroupResult describes one scheduled execution group.
type JobResult ¶
type JobResult struct {
Name string
Status JobStatus
StartedAt time.Time
FinishedAt time.Time
ArtifactIDs []string
Err error
}
JobResult is the execution outcome for one job.
type PlanMode ¶
type PlanMode string
PlanMode controls which plan artifacts TerraCi produces. It does not change dependency ordering or the high-level execution flow.
type Result ¶
type Result struct {
Groups []GroupResult
Jobs []*JobResult
}
Result is the aggregate outcome for a run.
type Scheduler ¶
Scheduler builds execution groups from a pipeline IR.
Returns an error if the IR is structurally invalid (cycles or duplicate job names) — preventing silent fallback that would run dependent jobs in the wrong order.
type WorkerPool ¶
type WorkerPool interface {
Run(ctx context.Context, jobs []*pipeline.Job, fn func(context.Context, *pipeline.Job) error) error
}
WorkerPool runs a group of jobs with bounded concurrency.
type Workspace ¶
type Workspace struct {
// contains filtered or unexported fields
}
Workspace centralizes canonical execution-domain paths.
func NewWorkspace ¶
NewWorkspace constructs a Workspace from absolute work and service directories.
func (Workspace) ModuleDir ¶
ModuleDir returns the absolute module directory for a relative module path.
func (Workspace) PlanJSONFile ¶
PlanJSONFile returns the absolute plan.json path for a module.
func (Workspace) PlanTextFile ¶
PlanTextFile returns the absolute plan.txt path for a module.
func (Workspace) ServiceDir ¶
func (Workspace) ServiceFile ¶
ServiceFile returns the absolute path to a file under the service directory.