Documentation
¶
Index ¶
- func FillSlot(node *execution.Node, graph *execution.Graph, slotName string, ...) error
- func MakeAttr(name string, fn BuiltinFunc) starlark.Value
- func NoSuchAttrError(receiver, attr string) error
- func PlanNames() []string
- type ArchivePlan
- type BuiltinFunc
- type EncryptionPlan
- type FilePlan
- type Gather
- type GitPlan
- type NetPlan
- type Output
- func (o *Output) Attr(name string) (starlark.Value, error)
- func (o *Output) AttrNames() []string
- func (o *Output) DependOn(consumer *execution.Node)
- func (o *Output) FillSlot(consumer *execution.Node, slotName string)
- func (o *Output) Freeze()
- func (o *Output) Graph() *execution.Graph
- func (o *Output) Hash() (uint32, error)
- func (o *Output) Node() *execution.Node
- func (o *Output) Path() string
- func (o *Output) Slot() string
- func (o *Output) String() string
- func (o *Output) Truth() starlark.Bool
- func (o *Output) Type() string
- type PackageContext
- type PhaseContext
- type PkgPlan
- type Plan
- type PlanFactory
- type PlanRoot
- type Receiver
- type ServicePlan
- type ShellPlan
- type TemplatePlan
- type UiReceiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillSlot ¶
func FillSlot(node *execution.Node, graph *execution.Graph, slotName string, value starlark.Value) error
FillSlot fills a slot in a node from a Starlark value.
Any slot accepts:
- A promise (Output): creates an edge, value flows at runtime
- A gather (Gather): creates edges from all members (parallel execution)
- An immediate value: stored directly, known at analysis time
func MakeAttr ¶
func MakeAttr(name string, fn BuiltinFunc) starlark.Value
MakeAttr creates a starlark.Builtin from a receiver method.
func NoSuchAttrError ¶
NoSuchAttrError returns an error for an unknown attribute.
Types ¶
type ArchivePlan ¶
type ArchivePlan struct {
Receiver
// contains filtered or unexported fields
}
func NewArchivePlan ¶
func NewArchivePlan(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) *ArchivePlan
func (*ArchivePlan) AttrNames ¶
func (p *ArchivePlan) AttrNames() []string
type BuiltinFunc ¶
type BuiltinFunc func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)
BuiltinFunc is the signature for builtin function implementations.
type EncryptionPlan ¶
type EncryptionPlan struct {
Receiver
// contains filtered or unexported fields
}
func NewEncryptionPlan ¶
func NewEncryptionPlan(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) *EncryptionPlan
func (*EncryptionPlan) AttrNames ¶
func (p *EncryptionPlan) AttrNames() []string
type FilePlan ¶
type FilePlan struct {
Receiver
// contains filtered or unexported fields
}
func NewFilePlan ¶
type Gather ¶
type Gather struct {
// contains filtered or unexported fields
}
Gather represents a collection of outputs that can run in parallel. When used as a slot input, it creates edges from ALL members to the consumer, enabling parallel execution of the gathered nodes.
Usage in Starlark:
a = plan.file.copy(src1, dst1) b = plan.file.copy(src2, dst2) c = plan.file.copy(src3, dst3) group = plan.gather(a, b, c) d = plan.whatever(group) # d waits for a, b, c (which run in parallel)
type GitPlan ¶
type GitPlan struct {
Receiver
// contains filtered or unexported fields
}
func NewGitPlan ¶
type NetPlan ¶
type NetPlan struct {
Receiver
// contains filtered or unexported fields
}
func NewNetPlan ¶
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output represents a promise - a handle to a node's output that can flow through the graph to fill slots in other nodes.
When passed to a plan function's slot, it creates an edge in the graph. The same promise can flow to multiple slots (fan-out).
func ResolveInput ¶
ResolveInput extracts an *Output from a Starlark value. Returns an error if the value is not an Output.
func (*Output) DependOn ¶
DependOn creates an edge making the given node depend on this output's node.
func (*Output) FillSlot ¶
FillSlot fills a slot in the consumer node with this promise, creating an edge. This is called when a promise is passed to a plan function.
type PackageContext ¶
type PackageContext struct {
// Name is the package name being deployed.
Name string
// Version is the version being deployed.
Version string
// Features are the enabled feature flags for this deployment.
Features []string
// Settings are key-value configuration settings.
Settings map[string]string
// DryRun indicates this is a preview (no actual changes).
DryRun bool
// SourceRoot is the package source directory in the registry cache.
SourceRoot string
// TargetRoot is the deployment target directory (usually $HOME).
TargetRoot string
}
PackageContext provides information about the package being deployed. Passed to phase scripts as the first argument.
func (*PackageContext) HasFeature ¶
func (p *PackageContext) HasFeature(name string) bool
HasFeature checks if a feature is enabled.
func (*PackageContext) Setting ¶
func (p *PackageContext) Setting(key string) string
Setting returns a setting value, or empty string if not set.
func (*PackageContext) ToStarlark ¶
func (p *PackageContext) ToStarlark() starlark.Value
ToStarlark converts the PackageContext to a Starlark receiver.
type PhaseContext ¶
type PhaseContext struct {
// PhaseName is the lifecycle phase (e.g., "install", "provision").
PhaseName string
// Action is the lifecycle action (e.g., "deploy", "remove").
Action string
// Retry holds the retry policy configured by the script.
Retry *execution.RetryPolicy
}
PhaseContext provides phase metadata to lifecycle scripts. Passed as the second call argument: def install(package, phase):
Starlark API:
phase.name # Phase name (e.g., "install", "provision") phase.action # Lifecycle action (e.g., "deploy", "remove") phase.retry(max_attempts=3, backoff="exponential")
func (*PhaseContext) ToStarlark ¶
func (c *PhaseContext) ToStarlark() starlark.Value
ToStarlark returns a Starlark value exposing phase.name, phase.action, phase.retry().
type PkgPlan ¶
type PkgPlan struct {
Receiver
// contains filtered or unexported fields
}
func NewPkgPlan ¶
type PlanFactory ¶
type PlanFactory func(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) starlark.Value
PlanFactory creates a plan sub-namespace for the given graph context.
type PlanRoot ¶
type PlanRoot struct {
// contains filtered or unexported fields
}
PlanRoot implements the top-level plan namespace using the slot-based model. Sub-namespaces are dynamically populated from the plan registry (each plan_*_gen.go registers via init()).
func NewPlanRoot ¶
func NewPlanRoot(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) *PlanRoot
NewPlanRoot creates a new PlanRoot for the given graph and host. Sub-namespaces are built dynamically from the plan registry.
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver provides common implementations for Starlark binding namespaces. Embed this in concrete types to satisfy starlark.Value. Concrete types must implement starlark.HasAttrs (Attr and AttrNames) themselves.
func NewReceiver ¶
NewReceiver creates a new Receiver with the given namespace name.
type ServicePlan ¶
type ServicePlan struct {
Receiver
// contains filtered or unexported fields
}
func NewServicePlan ¶
func NewServicePlan(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) *ServicePlan
func (*ServicePlan) AttrNames ¶
func (p *ServicePlan) AttrNames() []string
type ShellPlan ¶
type ShellPlan struct {
Receiver
// contains filtered or unexported fields
}
func NewShellPlan ¶
type TemplatePlan ¶
type TemplatePlan struct {
Receiver
// contains filtered or unexported fields
}
func NewTemplatePlan ¶
func NewTemplatePlan(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) *TemplatePlan
func (*TemplatePlan) AttrNames ¶
func (p *TemplatePlan) AttrNames() []string
type UiReceiver ¶
type UiReceiver struct {
Receiver
// contains filtered or unexported fields
}
func NewUiReceiver ¶
func NewUiReceiver(provider *ui.Provider) *UiReceiver
func (*UiReceiver) AttrNames ¶
func (r *UiReceiver) AttrNames() []string