Documentation
¶
Overview ¶
Package execution provides the core execution graph primitives and executor shared by writ (configuration deployment) and lore (package management).
Core Types ¶
- Graph: A directed graph of nodes and edges representing work to be done
- Node: A single unit of work with operations to execute
- Edge: A dependency relationship between nodes
Execution Model ¶
- GraphBuilder: Interface for building graphs (implementations in tools)
- GraphExecutor: Runs graphs by executing operations on nodes
- OperationRegistry: Maps operation names to implementations
Operations ¶
Each operation implements Operation.Execute(ctx, node). Content ops use ctx.ContentFor(node) and ctx.StoreContent(node, data) internally.
Graph Lifecycle ¶
The Graph represents both plans (before execution) and receipts (after execution):
- Before Run(): State is "pending", nodes describe what will happen
- After Run(): State is "executed", nodes describe what happened
- Serialized before execution: "dry-run" or "purchase order"
- Serialized after execution: "receipt"
Index ¶
- func ChecksumBytes(content []byte) string
- func ChecksumFile(path string) string
- func ExpandDelegates(ctx context.Context, graph *Graph, builder SubgraphBuilder, opts BuildOptions) error
- func GitStyleChecksum(objectType, basename string, content []byte) string
- type Attempt
- type BackoffStrategy
- type BackupOp
- type BuildOptions
- type Collision
- type Conflict
- type ConflictResolution
- type ConflictType
- type Context
- type CopyOp
- type DecryptOp
- type DependencyView
- func (v *DependencyView) AllDependencies(nodeID string) []string
- func (v *DependencyView) AllDependents(nodeID string) []string
- func (v *DependencyView) CriticalPath() []string
- func (v *DependencyView) Dependents(nodeID string) []string
- func (v *DependencyView) DependsOn(nodeID string) []string
- func (v *DependencyView) EdgeCount() int
- func (v *DependencyView) Graph() *Graph
- func (v *DependencyView) HasCycle() bool
- func (v *DependencyView) IndependentSets() [][]string
- func (v *DependencyView) Leaves() []string
- func (v *DependencyView) Node(id string) *Node
- func (v *DependencyView) NodeCount() int
- func (v *DependencyView) ParallelLevels() [][]string
- func (v *DependencyView) PathBetween(source, target string) []string
- func (v *DependencyView) Roots() []string
- func (v *DependencyView) Subgraph(nodeIDs []string) *DependencyView
- func (v *DependencyView) TopologicalOrder() []string
- type Edge
- type Encoder
- type EncryptionService
- type EntryType
- type ExecutorOptions
- type FileEntry
- type FileService
- func (f *FileService) Backup(path, backupSuffix string) (string, error)
- func (f *FileService) Copy(path string, mode os.FileMode, content []byte) (string, error)
- func (f *FileService) Link(source, path string) error
- func (f *FileService) Move(gitMv func(src, dst string) error, source, path string) error
- func (f *FileService) Remove(path string, prune bool, pruneBoundary string) error
- func (f *FileService) Render(templateData map[string]any, source, path, project string, content []byte) ([]byte, error)
- func (f *FileService) Unlink(path string, prune bool, pruneBoundary string) error
- func (f *FileService) Write(content, path string, mode os.FileMode) error
- type FileTree
- type FileTreeNode
- type Graph
- type GraphBuilder
- type GraphContext
- type GraphExecutor
- func (e *GraphExecutor) ExecutePhaseInner(ctx *Context, g *Graph, phase *Phase) error
- func (e *GraphExecutor) Run(ctx context.Context, g *Graph) error
- func (e *GraphExecutor) RunNodes(ctx context.Context, nodes []*Node, edges []Edge) ([]*Result, error)
- func (e *GraphExecutor) RunPhased(ctx context.Context, g *Graph) error
- type GraphState
- type HistoryRecord
- type LaunchdDisableOp
- type LaunchdEnableOp
- type LaunchdRestartOp
- type LaunchdStartOp
- type LaunchdStopOp
- type LinkOp
- type MoveOp
- type Node
- func (n *Node) GetID() string
- func (n *Node) GetMode() os.FileMode
- func (n *Node) GetOperation() string
- func (n *Node) GetProject() string
- func (n *Node) GetSlot(name string) any
- func (n *Node) RequireStringSlot(name string) (string, error)
- func (n *Node) SetSlotImmediate(name string, value any)
- func (n *Node) SetSlotPromise(name, nodeRef, slot string)
- type NodeStatus
- type Operation
- type OperationRegistry
- type PackageEntry
- type PackageInstallOp
- type PackageRemoveOp
- type PackageService
- func (p *PackageService) Install(packages []string, manager string, cask bool) error
- func (p *PackageService) Remove(packages []string, manager string, cask bool) error
- func (p *PackageService) Update(manager string) error
- func (p *PackageService) Upgrade(packages []string, manager string, cask bool) error
- type PackageUpdateOp
- type PackageUpgradeOp
- type Phase
- type PhaseStatus
- type Plan
- func (p *Plan) Backup(path string) *Node
- func (p *Plan) Copy(source, path string, transforms ...string) *Node
- func (p *Plan) CopyWithMode(source, path string, mode os.FileMode, transforms ...string) *Node
- func (p *Plan) DependsOn(from, to *Node)
- func (p *Plan) Graph() *Graph
- func (p *Plan) Link(source, path string) *Node
- func (p *Plan) Mkdir(path string) *Node
- func (p *Plan) Orders(from, to *Node)
- func (p *Plan) Remove(path string) *Node
- func (p *Plan) Rename(source, path string) *Node
- func (p *Plan) Unlink(path string) *Node
- func (p *Plan) Validate(check, message string) *Node
- type Platform
- type PowerShellOp
- type PreflightResult
- type RecoveryEntry
- type RecoveryStack
- type RemoveOp
- type RenderOp
- type Result
- type ResultStatus
- type RetryPolicy
- type RollbackEntry
- type ServiceManagerService
- func (s *ServiceManagerService) Disable(name string, output io.Writer) error
- func (s *ServiceManagerService) Enable(name string, output io.Writer) error
- func (s *ServiceManagerService) Restart(name string, output io.Writer) error
- func (s *ServiceManagerService) Start(name string, output io.Writer) error
- func (s *ServiceManagerService) Stop(name string, output io.Writer) error
- type ShellOp
- type ShellService
- type Signature
- type SlotValue
- type StateView
- type StateViewBuilder
- type SubgraphBuilder
- type Summary
- type SystemdDisableOp
- type SystemdEnableOp
- type SystemdRestartOp
- type SystemdStartOp
- type SystemdStopOp
- type UnlinkOp
- type ValidateOp
- type ViewOptions
- type WinServiceDisableOp
- type WinServiceEnableOp
- type WinServiceRestartOp
- type WinServiceStartOp
- type WinServiceStopOp
- type WriteOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChecksumBytes ¶
ChecksumBytes computes SHA256 of content and returns "sha256:<hex>".
func ChecksumFile ¶
ChecksumFile computes SHA256 of a file and returns "sha256:<hex>". Returns empty string if the file cannot be read.
func ExpandDelegates ¶
func ExpandDelegates(ctx context.Context, graph *Graph, builder SubgraphBuilder, opts BuildOptions) error
ExpandDelegates replaces delegate nodes in the graph with subgraphs produced by the given builder. Delegate nodes are identified by having "delegate" as their sole operation.
The expanded subgraph's nodes and edges are appended to the parent graph. An ordering edge is added from the delegate node to each root node of the subgraph.
The original delegate node is removed from the graph after expansion.
func GitStyleChecksum ¶
GitStyleChecksum computes a git-style checksum. Format: SHA256("<type> <basename> <len>\0<content>") Returns format "sha256:<hex>".
Types ¶
type Attempt ¶
type Attempt struct {
// Number is the 1-based attempt number.
Number int `json:"number" yaml:"number"`
// Status is "completed" or "failed".
Status string `json:"status" yaml:"status"`
// Error is the error message if the attempt failed.
Error string `json:"error,omitempty" yaml:"error,omitempty"`
// Timestamp is when this attempt completed (RFC3339).
Timestamp string `json:"timestamp" yaml:"timestamp"`
}
Attempt records one execution attempt of a phase.
type BackoffStrategy ¶
type BackoffStrategy string
BackoffStrategy defines how delays increase between retries.
const ( BackoffNone BackoffStrategy = "none" BackoffLinear BackoffStrategy = "linear" BackoffExponential BackoffStrategy = "exponential" )
type BackupOp ¶
type BackupOp struct{}
BackupOp moves the existing file at node's "path" slot to a timestamped backup. The backup path is stored in node.Annotations["backup_path"] after execution.
type BuildOptions ¶
type BuildOptions struct {
// DryRun prevents the builder from making filesystem queries with side effects.
DryRun bool
// Features lists enabled features (e.g., "rootless", "compose").
Features []string
// Data holds tool context: platform info, environment, segments.
Data map[string]any
}
BuildOptions configures subgraph building behavior.
type Collision ¶
type Collision struct {
Target string `json:"target" yaml:"target"`
Winner string `json:"winner" yaml:"winner"`
WinnerLayer string `json:"winner_layer,omitempty" yaml:"winner_layer,omitempty"`
WinnerSpecificity int `json:"winner_specificity,omitempty" yaml:"winner_specificity,omitempty"`
Loser string `json:"loser" yaml:"loser"`
LoserLayer string `json:"loser_layer,omitempty" yaml:"loser_layer,omitempty"`
LoserSpecificity int `json:"loser_specificity,omitempty" yaml:"loser_specificity,omitempty"`
}
Collision records a source conflict resolved during tree building (writ-specific).
type Conflict ¶
type Conflict struct {
Node *Node
Type ConflictType
ExistingPath string // For symlinks, where it points
Message string
}
Conflict represents a pre-flight detected conflict.
type ConflictResolution ¶
type ConflictResolution int
ConflictResolution specifies how to handle conflicts during execution.
const ( // ResolutionStop aborts execution on first conflict. ResolutionStop ConflictResolution = iota // ResolutionBackup moves conflicting files to timestamped backups. ResolutionBackup // ResolutionOverwrite removes conflicting files without backup. ResolutionOverwrite // ResolutionSkip skips conflicting files and continues. ResolutionSkip )
type ConflictType ¶
type ConflictType int
ConflictType describes the kind of conflict at a target path.
const ( // ConflictNone indicates no conflict exists. ConflictNone ConflictType = iota // ConflictRegularFile indicates a regular file exists at target. ConflictRegularFile // ConflictDirectory indicates a directory exists at target. ConflictDirectory // ConflictForeignSymlink indicates a symlink pointing elsewhere exists. ConflictForeignSymlink // ConflictOurSymlink indicates our symlink already exists (no action needed). ConflictOurSymlink )
type Context ¶
type Context struct {
context.Context
// DryRun prevents filesystem modifications when true.
DryRun bool
// Logger receives operation output messages.
Logger io.Writer
// Data holds tool-provided context: template variables, SOPS config,
// identities, segment maps, etc. Each tool populates this before
// calling GraphExecutor.Run().
Data map[string]any
// Content pipeline (set by executor before each execution loop).
Edges []Edge
Outputs map[string][]byte
// Per-node checksums (written by ops, read by executor).
SourceChecksum string
TargetChecksum string
}
Context provides execution context to operations.
func (*Context) ContentFor ¶
ContentFor resolves input content for a node. It checks the upstream chain via edges first, then falls back to reading the source file.
func (*Context) StoreContent ¶
StoreContent stores output content for a node so downstream nodes can read it.
type CopyOp ¶
type CopyOp struct{}
CopyOp writes content to node's "path" slot. Content is resolved via ctx.ContentFor (upstream chain or source file).
type DecryptOp ¶
type DecryptOp struct{}
DecryptOp decrypts content using the SOPS API. The decryption configuration is expected in ctx.Data. Stores the decrypted content for downstream ops.
type DependencyView ¶
type DependencyView struct {
// contains filtered or unexported fields
}
DependencyView provides dependency analysis for a single execution graph. It indexes the graph's edges to enable efficient dependency queries.
func NewDependencyView ¶
func NewDependencyView(g *Graph) *DependencyView
NewDependencyView creates a DependencyView for the given graph.
func (*DependencyView) AllDependencies ¶
func (v *DependencyView) AllDependencies(nodeID string) []string
AllDependencies returns the transitive closure of dependencies for a node. This includes all nodes that must complete before this node can start.
func (*DependencyView) AllDependents ¶
func (v *DependencyView) AllDependents(nodeID string) []string
AllDependents returns the transitive closure of dependents for a node. This includes all nodes that directly or indirectly depend on this node.
func (*DependencyView) CriticalPath ¶
func (v *DependencyView) CriticalPath() []string
CriticalPath returns the longest dependency chain in the graph. This represents the minimum sequential execution path.
func (*DependencyView) Dependents ¶
func (v *DependencyView) Dependents(nodeID string) []string
Dependents returns the direct dependents of a node (nodes that wait for this one).
func (*DependencyView) DependsOn ¶
func (v *DependencyView) DependsOn(nodeID string) []string
DependsOn returns the direct dependencies of a node (nodes that must complete first).
func (*DependencyView) EdgeCount ¶
func (v *DependencyView) EdgeCount() int
EdgeCount returns the number of edges in the graph.
func (*DependencyView) Graph ¶
func (v *DependencyView) Graph() *Graph
Graph returns the underlying graph.
func (*DependencyView) HasCycle ¶
func (v *DependencyView) HasCycle() bool
HasCycle returns true if the graph contains a cycle.
func (*DependencyView) IndependentSets ¶
func (v *DependencyView) IndependentSets() [][]string
IndependentSets returns groups of nodes that have no dependencies between them. Each set can be executed fully in parallel with other sets.
func (*DependencyView) Leaves ¶
func (v *DependencyView) Leaves() []string
Leaves returns nodes with no dependents (final nodes in the graph).
func (*DependencyView) Node ¶
func (v *DependencyView) Node(id string) *Node
Node returns the node with the given ID, or nil if not found.
func (*DependencyView) NodeCount ¶
func (v *DependencyView) NodeCount() int
NodeCount returns the number of nodes in the graph.
func (*DependencyView) ParallelLevels ¶
func (v *DependencyView) ParallelLevels() [][]string
ParallelLevels returns nodes grouped by execution level. Level 0 contains roots (can execute immediately). Level N contains nodes whose dependencies are all in levels < N. Within each level, nodes can execute in parallel.
func (*DependencyView) PathBetween ¶
func (v *DependencyView) PathBetween(source, target string) []string
PathBetween returns the shortest path from source to target, or nil if none exists.
func (*DependencyView) Roots ¶
func (v *DependencyView) Roots() []string
Roots returns nodes with no dependencies (can execute immediately).
func (*DependencyView) Subgraph ¶
func (v *DependencyView) Subgraph(nodeIDs []string) *DependencyView
Subgraph returns a new DependencyView containing only the specified nodes and the edges between them.
func (*DependencyView) TopologicalOrder ¶
func (v *DependencyView) TopologicalOrder() []string
TopologicalOrder returns nodes in a valid execution order. Nodes appear after all their dependencies. Returns nil if the graph has a cycle.
type Edge ¶
Edge represents a dependency relationship between two nodes. From must complete before To can begin execution.
type Encoder ¶
Encoder is the interface for graph serialization. Both *json.Encoder and *yaml.Encoder satisfy this interface.
type EncryptionService ¶
type EncryptionService struct{}
EncryptionService provides encryption and decryption operations. The actual crypto backend (SOPS, age, etc.) is injected via function parameters, keeping this service independent of specific libraries.
func (*EncryptionService) Decrypt ¶
func (e *EncryptionService) Decrypt(decryptor func(string, []byte) ([]byte, error), source string, content []byte) ([]byte, error)
Decrypt decrypts content using the provided decryptor function. The source path enables format detection (e.g., .sops.yaml vs .age). Returns the decrypted bytes.
type ExecutorOptions ¶
type ExecutorOptions struct {
// DryRun prevents filesystem modifications.
DryRun bool
// Logger receives operation output.
Logger io.Writer
// Data holds tool-provided context (template vars, SOPS config, etc.).
Data map[string]any
// ConflictResolution specifies how to handle conflicts detected during preflight.
ConflictResolution ConflictResolution
// BackupSuffix is appended to backup filenames (default: ".writ-backup").
BackupSuffix string
}
ExecutorOptions configures GraphExecutor behavior.
type FileEntry ¶
type FileEntry struct {
// Target is the relative target path (e.g., ".bashrc").
Target string `json:"target" yaml:"target"`
// Source is the absolute source path.
Source string `json:"source" yaml:"source"`
// Project this file belongs to.
Project string `json:"project" yaml:"project"`
// Layer is the repository layer (base, team, personal).
Layer string `json:"layer,omitempty" yaml:"layer,omitempty"`
// History of deployment operations, ordered by time.
History []HistoryRecord `json:"history" yaml:"history"`
}
FileEntry represents a project file's deployment history.
func (*FileEntry) IsCopied ¶
IsCopied returns true if the latest operation was a copy (not symlink).
func (*FileEntry) LastOperation ¶
func (e *FileEntry) LastOperation() *HistoryRecord
LastOperation returns the most recent operation, or nil if no history.
func (*FileEntry) SourceChecksum ¶
SourceChecksum returns the source checksum from the latest operation.
func (*FileEntry) TargetChecksum ¶
TargetChecksum returns the target checksum from the latest operation.
type FileService ¶
type FileService struct{}
FileService provides file system operations. Each method receives all inputs as parameters — no execution context, no node access. These methods are the source of truth for the code generator.
func (*FileService) Backup ¶
func (f *FileService) Backup(path, backupSuffix string) (string, error)
Backup moves the file at path to a timestamped backup location. Returns the backup path.
func (*FileService) Copy ¶
Copy writes content to path with the given mode. Returns the SHA256 checksum of the written content.
func (*FileService) Link ¶
func (f *FileService) Link(source, path string) error
Link creates a symlink at path pointing to source. Idempotent: if the symlink already points correctly, it's a no-op.
func (*FileService) Move ¶
func (f *FileService) Move(gitMv func(src, dst string) error, source, path string) error
Move moves a file from source to path. Uses gitMv if provided (preserves git history), falling back to os.Rename.
func (*FileService) Remove ¶
func (f *FileService) Remove(path string, prune bool, pruneBoundary string) error
Remove deletes the file at path. If prune is true and pruneBoundary is set, empty parent directories are removed up to the boundary.
func (*FileService) Render ¶
func (f *FileService) Render(templateData map[string]any, source, path, project string, content []byte) ([]byte, error)
Render processes content as a Go text/template. Returns the rendered bytes.
type FileTree ¶
type FileTree struct {
// Root is the target root path (e.g., $HOME).
Root string `json:"root" yaml:"root"`
// Entries provides flat lookup by relative target path.
Entries map[string]*FileEntry `json:"entries" yaml:"entries"`
// Tree is the hierarchical view.
Tree *FileTreeNode `json:"tree" yaml:"tree"`
}
FileTree provides both flat and hierarchical access to files.
func (*FileTree) CopiedFiles ¶
CopiedFiles returns all entries that were copied (not symlinked).
func (*FileTree) ForProject ¶
ForProject returns all file entries for a specific project.
func (*FileTree) LinkedFiles ¶
LinkedFiles returns all entries that are symlinks.
type FileTreeNode ¶
type FileTreeNode struct {
// Name is the filename or directory name.
Name string `json:"name" yaml:"name"`
// IsDir is true if this is a directory.
IsDir bool `json:"is_dir" yaml:"is_dir"`
// Entry is the file entry (nil for directories).
Entry *FileEntry `json:"entry,omitempty" yaml:"entry,omitempty"`
// Children are the child nodes (nil for files).
Children map[string]*FileTreeNode `json:"children,omitempty" yaml:"children,omitempty"`
}
FileTreeNode represents a node in the target filesystem tree.
type Graph ¶
type Graph struct {
// Version is the graph format version.
Version string `json:"version" yaml:"version"`
// Tool identifies which tool created this graph ("writ" or "lore").
Tool string `json:"tool" yaml:"tool"`
// Timestamp is when the graph was created/executed.
Timestamp time.Time `json:"timestamp" yaml:"timestamp"`
// State is the execution state (pending, executed, failed).
State GraphState `json:"state" yaml:"state"`
// Platform records the OS and architecture.
Platform Platform `json:"platform" yaml:"platform"`
// Context contains tool-specific metadata.
Context GraphContext `json:"context" yaml:"context"`
// Nodes are the operations to perform/performed.
Nodes []*Node `json:"nodes" yaml:"nodes"`
// Edges are the dependencies between nodes.
Edges []Edge `json:"edges,omitempty" yaml:"edges,omitempty"`
// Phases defines the ordered lifecycle phases (nil for non-phased graphs).
// When present, the executor uses phase-aware execution with retry and rollback.
// When nil, the executor falls back to flat node execution.
Phases []*Phase `json:"phases,omitempty" yaml:"phases,omitempty"`
// Collisions records source conflicts resolved during tree building (writ-specific).
Collisions []Collision `json:"collisions,omitempty" yaml:"collisions,omitempty"`
// Summary contains execution statistics (populated after Run).
Summary Summary `json:"summary,omitempty" yaml:"summary,omitempty"`
// Rollback records compensating actions executed during rollback (populated on failure).
Rollback []RollbackEntry `json:"rollback,omitempty" yaml:"rollback,omitempty"`
// Checksum is the git-style integrity hash.
Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"`
// Signature contains the cryptographic signature (optional).
Signature *Signature `json:"signature,omitempty" yaml:"signature,omitempty"`
}
Graph represents an execution graph containing nodes and edges. This is THE graph used by both writ and lore - they differ only in content.
Before Run(): State is "pending", represents the plan After Run(): State is "executed", represents the receipt
func (*Graph) ApplyResults ¶
ApplyResults updates node states from execution results.
func (*Graph) CanonicalContent ¶
CanonicalContent returns the graph serialized as YAML without checksum and signature. This is used for computing checksums and verifying signatures.
func (*Graph) ComputeSummary ¶
func (g *Graph) ComputeSummary()
ComputeSummary calculates summary statistics from nodes. For phased graphs, node statuses reflect the phase execution outcome (nodes in rolled-back phases may show as completed from before rollback).
func (*Graph) Filename ¶
Filename returns the standard filename for this graph. Format: "<tool>-<timestamp>.yaml"
type GraphBuilder ¶
type GraphBuilder interface {
// Build creates an execution graph.
// Implementations hold their configuration internally (set at construction).
Build(ctx context.Context) (*Graph, error)
}
GraphBuilder is the interface for building execution graphs. Implementations are provided by tools (writ, lore) and create graphs from their respective inputs (file trees, package manifests, etc.).
type GraphContext ¶
type GraphContext struct {
// SourceRoot is the source directory (writ: repo path, lore: registry cache).
SourceRoot string `json:"source_root,omitempty" yaml:"source_root,omitempty"`
// TargetRoot is the target directory (typically $HOME).
TargetRoot string `json:"target_root,omitempty" yaml:"target_root,omitempty"`
// Projects lists the projects included (writ-specific).
Projects []string `json:"projects,omitempty" yaml:"projects,omitempty"`
// Packages lists the packages included (lore-specific).
Packages []string `json:"packages,omitempty" yaml:"packages,omitempty"`
// Segments contains platform segment values (writ-specific).
Segments map[string]string `json:"segments,omitempty" yaml:"segments,omitempty"`
// Layers lists repository layers used (writ-specific).
Layers []string `json:"layers,omitempty" yaml:"layers,omitempty"`
// Platform is the target platform string (lore-specific, e.g., "Darwin", "Linux.Debian").
TargetPlatform string `json:"target_platform,omitempty" yaml:"target_platform,omitempty"`
// Features enabled for package installation (lore-specific).
Features []string `json:"features,omitempty" yaml:"features,omitempty"`
// Settings for package installation (lore-specific).
Settings map[string]string `json:"settings,omitempty" yaml:"settings,omitempty"`
}
GraphContext contains tool-specific metadata stored in the graph. Both writ and lore populate this with their relevant context.
type GraphExecutor ¶
type GraphExecutor struct {
// contains filtered or unexported fields
}
GraphExecutor executes operation graphs.
func NewGraphExecutor ¶
func NewGraphExecutor(registry *OperationRegistry, opts ExecutorOptions) *GraphExecutor
NewGraphExecutor creates an executor with the given registry and options.
func (*GraphExecutor) ExecutePhaseInner ¶
func (e *GraphExecutor) ExecutePhaseInner(ctx *Context, g *Graph, phase *Phase) error
ExecutePhaseInner runs all inner nodes of a phase using the executor. It extracts the phase's nodes from the graph and runs them in topological order. Any node failure immediately fails the phase.
func (*GraphExecutor) Run ¶
func (e *GraphExecutor) Run(ctx context.Context, g *Graph) error
Run executes all nodes in the graph, respecting ordering constraints. When the graph has phases, execution is delegated to RunPhased which implements the saga pattern with retry and rollback. Otherwise, nodes are processed in topological order (flat execution).
func (*GraphExecutor) RunNodes ¶
func (e *GraphExecutor) RunNodes(ctx context.Context, nodes []*Node, edges []Edge) ([]*Result, error)
RunNodes executes a slice of nodes with the given edges. This is a lower-level API for callers that don't have a full Graph.
func (*GraphExecutor) RunPhased ¶
func (e *GraphExecutor) RunPhased(ctx context.Context, g *Graph) error
RunPhased executes a phased graph using the saga pattern. Phases are executed in order. Each phase runs its inner nodes via topological sort. On failure, completed phases are compensated in LIFO order (rollback).
Phases referenced as compensating actions (via Compensate fields) are skipped during the forward pass — they execute only during rollback.
type GraphState ¶
type GraphState string
GraphState represents the execution state of the graph.
const ( StatePending GraphState = "pending" StateExecuted GraphState = "executed" StateFailed GraphState = "failed" )
type HistoryRecord ¶
type HistoryRecord struct {
// Timestamp is when this operation occurred.
Timestamp time.Time `json:"timestamp" yaml:"timestamp"`
// Receipt is the filename of the receipt that recorded this.
Receipt string `json:"receipt" yaml:"receipt"`
// Tool is which tool created this record ("lore" or "writ").
Tool string `json:"tool" yaml:"tool"`
// Operation performed: link, copy, render, decrypt, install, etc.
Operation string `json:"operation" yaml:"operation"`
// Status of this operation: completed, skipped, failed.
Status NodeStatus `json:"status" yaml:"status"`
// SourceChecksum is the SHA256 of the source at operation time.
SourceChecksum string `json:"source_checksum,omitempty" yaml:"source_checksum,omitempty"`
// TargetChecksum is the SHA256 of the target after operation.
TargetChecksum string `json:"target_checksum,omitempty" yaml:"target_checksum,omitempty"`
}
HistoryRecord represents a single operation on an entry from a receipt.
type LaunchdDisableOp ¶
type LaunchdDisableOp struct{}
LaunchdDisableOp disables a launchd service at boot (macOS).
func (*LaunchdDisableOp) Execute ¶
func (o *LaunchdDisableOp) Execute(ctx *Context, node *Node) error
func (*LaunchdDisableOp) Name ¶
func (o *LaunchdDisableOp) Name() string
type LaunchdEnableOp ¶
type LaunchdEnableOp struct{}
LaunchdEnableOp enables a launchd service at boot (macOS).
func (*LaunchdEnableOp) Name ¶
func (o *LaunchdEnableOp) Name() string
type LaunchdRestartOp ¶
type LaunchdRestartOp struct{}
LaunchdRestartOp restarts a launchd service (macOS).
func (*LaunchdRestartOp) Execute ¶
func (o *LaunchdRestartOp) Execute(ctx *Context, node *Node) error
func (*LaunchdRestartOp) Name ¶
func (o *LaunchdRestartOp) Name() string
type LaunchdStartOp ¶
type LaunchdStartOp struct{}
LaunchdStartOp starts a launchd service (macOS).
func (*LaunchdStartOp) Name ¶
func (o *LaunchdStartOp) Name() string
type LaunchdStopOp ¶
type LaunchdStopOp struct{}
LaunchdStopOp stops a launchd service (macOS).
func (*LaunchdStopOp) Name ¶
func (o *LaunchdStopOp) Name() string
type LinkOp ¶
type LinkOp struct{}
LinkOp creates a symlink from node's "path" slot pointing to "source" slot.
type MoveOp ¶
type MoveOp struct{}
MoveOp moves a file or directory from node's "source" slot to "path" slot using git mv when inside a git repository, falling back to os.Rename otherwise.
type Node ¶
type Node struct {
// ID is the unique identifier (typically relative target path or package name).
ID string `json:"id" yaml:"id"`
// Operation to perform: link, copy, render, decrypt, install, etc.
Operation string `json:"operation" yaml:"operation"`
// Status of this node: pending, completed, skipped, failed.
Status NodeStatus `json:"status" yaml:"status"`
// Timestamp is when this operation completed.
Timestamp string `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
// Slots holds input values for this node. Each slot can be:
// - Immediate: value known at analysis time
// - Promise: reference to another node's output (creates edge)
Slots map[string]SlotValue `json:"slots,omitempty" yaml:"slots,omitempty"`
// Project this node belongs to.
Project string `json:"project,omitempty" yaml:"project,omitempty"`
// Layer is the repository layer (base, team, personal).
Layer string `json:"layer,omitempty" yaml:"layer,omitempty"`
// Mode is the file permissions to set.
Mode os.FileMode `json:"-" yaml:"-"`
// SourceChecksum is the SHA256 of the source file at deploy time.
SourceChecksum string `json:"source_checksum,omitempty" yaml:"source_checksum,omitempty"`
// TargetChecksum is the SHA256 of the target file after deployment.
TargetChecksum string `json:"target_checksum,omitempty" yaml:"target_checksum,omitempty"`
// Error message if status is failed.
Error string `json:"error,omitempty" yaml:"error,omitempty"`
// Annotations holds extensible metadata (serialized to receipts).
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}
Node represents a single unit of work in an execution graph.
func (*Node) GetOperation ¶
GetOperation returns the operation to perform.
func (*Node) GetSlot ¶
GetSlot returns the resolved value of a slot. If the slot is a promise, returns nil (must be resolved by executor).
func (*Node) RequireStringSlot ¶
RequireStringSlot returns the string value of a required slot. Returns an error if the slot is not set, or holds a non-string value. An empty string is valid — use GetSlot for optional slots where zero value is acceptable.
func (*Node) SetSlotImmediate ¶
SetSlotImmediate sets a slot to an immediate value.
func (*Node) SetSlotPromise ¶
SetSlotPromise sets a slot to a promise (reference to another node).
type NodeStatus ¶
type NodeStatus string
NodeStatus represents the execution status of a node.
const ( StatusPending NodeStatus = "pending" StatusCompleted NodeStatus = "completed" StatusSkipped NodeStatus = "skipped" StatusFailed NodeStatus = "failed" )
type Operation ¶
type Operation interface {
// Name returns the operation identifier (e.g., "file.link", "file.decrypt").
Name() string
// Execute performs the operation using context and node state.
Execute(ctx *Context, node *Node) error
}
Operation is the interface for all executable actions. Each operation is self-contained: it reads its own inputs via ctx and node, performs its work, and stores any outputs back on ctx.
func AllOps ¶
func AllOps() []Operation
AllOps returns all operations (file + package) for registration. Both writ and lore should use this to ensure the same operations are available.
func FileOps ¶
func FileOps() []Operation
FileOps returns all built-in file operations for registration.
func PackageOps ¶
func PackageOps() []Operation
PackageOps returns all package manager operations for registration.
func ServiceOps ¶
func ServiceOps() []Operation
ServiceOps returns all service manager operations for registration.
type OperationRegistry ¶
type OperationRegistry struct {
// contains filtered or unexported fields
}
OperationRegistry maps operation names to their implementations. Each tool registers its operations before calling GraphExecutor.Run().
func NewOperationRegistry ¶
func NewOperationRegistry() *OperationRegistry
NewOperationRegistry creates an empty operation registry.
func (*OperationRegistry) Get ¶
func (r *OperationRegistry) Get(name string) (Operation, bool)
Get returns the operation registered under the given name.
func (*OperationRegistry) Names ¶
func (r *OperationRegistry) Names() []string
Names returns all registered operation names.
func (*OperationRegistry) Register ¶
func (r *OperationRegistry) Register(op Operation)
Register adds an operation to the registry. If an operation with the same name already exists, it is replaced.
type PackageEntry ¶
type PackageEntry struct {
// Name is the package name (e.g., "docker").
Name string `json:"name" yaml:"name"`
// History of lifecycle operations, ordered by time.
History []HistoryRecord `json:"history" yaml:"history"`
}
PackageEntry represents a lore package's lifecycle history.
func (*PackageEntry) LastOperation ¶
func (e *PackageEntry) LastOperation() *HistoryRecord
LastOperation returns the most recent operation, or nil if no history.
type PackageInstallOp ¶
type PackageInstallOp struct{}
PackageInstallOp installs packages using the platform's package manager.
func (*PackageInstallOp) Execute ¶
func (o *PackageInstallOp) Execute(ctx *Context, node *Node) error
func (*PackageInstallOp) Name ¶
func (o *PackageInstallOp) Name() string
type PackageRemoveOp ¶
type PackageRemoveOp struct{}
PackageRemoveOp removes packages using the platform's package manager.
func (*PackageRemoveOp) Name ¶
func (o *PackageRemoveOp) Name() string
type PackageService ¶
type PackageService struct{}
PackageService provides platform-independent package management. The package manager is resolved at runtime via host.PackageManager().
func (*PackageService) Install ¶
func (p *PackageService) Install(packages []string, manager string, cask bool) error
Install installs packages using the platform's package manager.
func (*PackageService) Remove ¶
func (p *PackageService) Remove(packages []string, manager string, cask bool) error
Remove removes packages using the platform's package manager.
func (*PackageService) Update ¶
func (p *PackageService) Update(manager string) error
Update refreshes the package manager index.
type PackageUpdateOp ¶
type PackageUpdateOp struct{}
PackageUpdateOp refreshes the package manager index.
func (*PackageUpdateOp) Name ¶
func (o *PackageUpdateOp) Name() string
type PackageUpgradeOp ¶
type PackageUpgradeOp struct{}
PackageUpgradeOp upgrades packages using the platform's package manager.
func (*PackageUpgradeOp) Execute ¶
func (o *PackageUpgradeOp) Execute(ctx *Context, node *Node) error
func (*PackageUpgradeOp) Name ¶
func (o *PackageUpgradeOp) Name() string
type Phase ¶
type Phase struct {
// ID is the unique identifier (e.g., "phase.install").
ID string `json:"id" yaml:"id"`
// Name is the phase name (e.g., "install").
Name string `json:"name" yaml:"name"`
// Status of this phase: pending, completed, failed, rolled_back, skipped.
Status PhaseStatus `json:"status" yaml:"status"`
// Retry governs retry behavior when inner nodes fail.
Retry *RetryPolicy `json:"retry,omitempty" yaml:"retry,omitempty"`
// NodeIDs lists the IDs of inner nodes belonging to this phase.
NodeIDs []string `json:"nodes,omitempty" yaml:"nodes,omitempty"`
// Compensate is the ID of the compensating action for rollback.
Compensate string `json:"compensate,omitempty" yaml:"compensate,omitempty"`
// Attempts records retry history (populated during execution).
Attempts []Attempt `json:"attempts,omitempty" yaml:"attempts,omitempty"`
// State holds execution metadata captured during the forward action.
// The compensating action reads this to know what to undo.
State map[string]any `json:"state,omitempty" yaml:"state,omitempty"`
}
Phase represents a lifecycle phase in the execution graph. Each phase owns a set of inner nodes and acts as an error boundary with retry and compensating action support (the Saga Pattern).
type PhaseStatus ¶
type PhaseStatus string
PhaseStatus represents the execution state of a phase.
const ( PhasePending PhaseStatus = "pending" PhaseCompleted PhaseStatus = "completed" PhaseFailed PhaseStatus = "failed" PhaseRolledBack PhaseStatus = "rolled_back" PhaseSkipped PhaseStatus = "skipped" )
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan provides binding functions for building an execution graph. Graph producers (writ tree builder, lore pipeline executor, LLM graph builder) use Plan to add operations to the graph. Each method returns the created node for edge construction.
In Starlark scripts, the plan object is passed to each phase function:
def install(system, package, plan):
plan.mkdir("/usr/local/bin")
plan.link("/usr/local/bin/foo", source="/path/to/foo")
func (*Plan) Copy ¶
Copy adds a file copy operation. Transforms (decrypt, render) create a chain of nodes connected by edges, with content flowing between them.
func (*Plan) CopyWithMode ¶
CopyWithMode adds a file copy operation with explicit permissions.
type PowerShellOp ¶
type PowerShellOp struct{}
PowerShellOp executes a PowerShell command from node's "command" slot (Windows).
func (*PowerShellOp) Name ¶
func (o *PowerShellOp) Name() string
type PreflightResult ¶
type PreflightResult struct {
Conflicts []Conflict
AlreadyDone []Conflict // Symlinks that already point correctly
Ready []*Node // Nodes ready to deploy (no conflict)
}
PreflightResult contains the results of pre-flight conflict detection.
func Preflight ¶
func Preflight(graph *Graph) *PreflightResult
Preflight performs pre-flight conflict detection without modifying anything. Only applies to nodes with file operations (link, copy).
func (*PreflightResult) HasConflicts ¶
func (p *PreflightResult) HasConflicts() bool
HasConflicts returns true if any conflicts were detected.
type RecoveryEntry ¶
type RecoveryEntry struct {
// PhaseID is the unique identifier of the completed phase.
PhaseID string
// PhaseName is the human-readable phase name.
PhaseName string
// Compensate is the function to execute for rollback.
// It receives the execution context and returns any error.
Compensate func(ctx *Context) error
// State holds the execution metadata captured during the forward action.
// Passed to the compensating action so it knows what to undo.
State map[string]any
}
RecoveryEntry represents a completed phase and its compensating action. The executor pushes entries as phases complete successfully, and pops them in LIFO order during rollback.
type RecoveryStack ¶
type RecoveryStack struct {
// contains filtered or unexported fields
}
RecoveryStack is a LIFO stack of recovery entries. The executor pushes entries as phases complete and unwinds (pops + executes compensating actions) on failure.
func (*RecoveryStack) Entries ¶
func (s *RecoveryStack) Entries() []RecoveryEntry
Entries returns a copy of the stack entries (bottom to top). Used for inspection and serialization.
func (*RecoveryStack) Len ¶
func (s *RecoveryStack) Len() int
Len returns the number of entries on the stack.
func (*RecoveryStack) Push ¶
func (s *RecoveryStack) Push(entry RecoveryEntry)
Push adds a recovery entry to the top of the stack.
func (*RecoveryStack) Unwind ¶
func (s *RecoveryStack) Unwind(ctx *Context) []error
Unwind executes all compensating actions in LIFO order. Returns a slice of errors from compensating actions that failed. Compensating action failures do not stop the unwind — all entries are processed regardless of individual failures.
type RemoveOp ¶
type RemoveOp struct{}
RemoveOp deletes the file at node's "path" slot. If ctx.Data["prune_empty_dirs"] is true and ctx.Data["prune_boundary"] is set, empty parent directories are removed up to the boundary.
type RenderOp ¶
type RenderOp struct{}
RenderOp processes content as a Go text/template with ctx.Data as the template data. Stores the rendered content for downstream ops.
type Result ¶
type Result struct {
NodeID string
Status ResultStatus
Error error
Message string
SourceChecksum string
TargetChecksum string
}
Result represents the outcome of executing a single node.
type ResultStatus ¶
type ResultStatus int
ResultStatus represents the execution status of a node.
const ( // ResultPending means the node has not been processed yet. ResultPending ResultStatus = iota // ResultRunning means the node is currently executing. ResultRunning // ResultCompleted means the node executed successfully. ResultCompleted // ResultFailed means the node encountered an error. ResultFailed // ResultSkipped means the node was skipped (conflict, already deployed, etc.). ResultSkipped )
func (ResultStatus) String ¶
func (s ResultStatus) String() string
String returns a human-readable status label.
type RetryPolicy ¶
type RetryPolicy struct {
// MaxAttempts is the maximum number of retries (0 = no retry, fail immediately).
MaxAttempts int `json:"max_attempts" yaml:"max_attempts"`
// Backoff is the delay strategy: none, linear, exponential.
Backoff BackoffStrategy `json:"backoff" yaml:"backoff"`
// InitialDelay is the delay before the first retry (Go duration string, e.g. "1s").
InitialDelay string `json:"initial_delay,omitempty" yaml:"initial_delay,omitempty"`
// MaxDelay caps the delay between retries (Go duration string, e.g. "30s").
MaxDelay string `json:"max_delay,omitempty" yaml:"max_delay,omitempty"`
}
RetryPolicy configures retry behavior for a phase.
func (*RetryPolicy) ComputeDelay ¶
func (r *RetryPolicy) ComputeDelay(attempt int) time.Duration
ComputeDelay returns the delay for a given attempt number (0-based).
func (*RetryPolicy) ParseInitialDelay ¶
func (r *RetryPolicy) ParseInitialDelay() time.Duration
ParseInitialDelay parses the InitialDelay string into a time.Duration. Returns 0 if the string is empty or unparseable.
func (*RetryPolicy) ParseMaxDelay ¶
func (r *RetryPolicy) ParseMaxDelay() time.Duration
ParseMaxDelay parses the MaxDelay string into a time.Duration. Returns 0 if the string is empty or unparseable.
type RollbackEntry ¶
type RollbackEntry struct {
// Phase is the phase name that was rolled back.
Phase string `json:"phase" yaml:"phase"`
// Compensate is the ID of the compensating action.
Compensate string `json:"compensate" yaml:"compensate"`
// Status is "completed" or "failed".
Status string `json:"status" yaml:"status"`
// Error is the error message if the compensating action failed.
Error string `json:"error,omitempty" yaml:"error,omitempty"`
}
RollbackEntry records a compensating action executed during rollback.
type ServiceManagerService ¶
type ServiceManagerService struct{}
ServiceManagerService provides platform-agnostic service management. Platform detection happens at runtime — callers don't need to know whether launchd, systemd, or Windows services are being used.
func (*ServiceManagerService) Disable ¶
func (s *ServiceManagerService) Disable(name string, output io.Writer) error
Disable disables a service from starting at boot.
func (*ServiceManagerService) Enable ¶
func (s *ServiceManagerService) Enable(name string, output io.Writer) error
Enable enables a service to start at boot.
func (*ServiceManagerService) Restart ¶
func (s *ServiceManagerService) Restart(name string, output io.Writer) error
Restart restarts a service.
type ShellService ¶
type ShellService struct{}
ShellService provides shell command execution.
func (*ShellService) PowerShell ¶
func (s *ShellService) PowerShell(command string, output io.Writer) error
PowerShell executes a PowerShell command (Windows).
type Signature ¶
type Signature struct {
// Method is the signing method used (gpg, aws_kms, gcp_kms, azure_kv).
Method string `json:"method" yaml:"method"`
// Value is the signature data (base64-encoded).
Value string `json:"value" yaml:"value"`
// KeyID identifies the key used for signing.
// For GPG: fingerprint, for KMS: key ARN/ID/URL.
KeyID string `json:"key_id" yaml:"key_id"`
}
Signature contains the cryptographic signature of a graph.
type SlotValue ¶
type SlotValue struct {
// Immediate is the direct value (any type, known at analysis time).
Immediate any `json:"immediate,omitempty" yaml:"immediate,omitempty"`
// NodeRef is the ID of the node that produces this value (promise).
NodeRef string `json:"node_ref,omitempty" yaml:"node_ref,omitempty"`
// Slot is which output slot of the referenced node (empty = default output).
Slot string `json:"slot,omitempty" yaml:"slot,omitempty"`
}
SlotValue represents a value that fills a slot in a node. Either Immediate is set (direct value) or NodeRef is set (promise from upstream node).
func (SlotValue) IsImmediate ¶
IsImmediate returns true if this slot value is an immediate value.
type StateView ¶
type StateView struct {
// Since is the start of the time window (inclusive).
Since time.Time `json:"since" yaml:"since"`
// Until is the end of the time window (inclusive).
Until time.Time `json:"until" yaml:"until"`
// ReceiptCount is the number of receipts included in this view.
ReceiptCount int `json:"receipt_count" yaml:"receipt_count"`
// Packages maps package names to their lifecycle history.
Packages map[string]*PackageEntry `json:"packages" yaml:"packages"`
// Files provides file entry access (flat and tree).
Files *FileTree `json:"files" yaml:"files"`
}
StateView is a read-only view over multiple execution graphs. It represents "what we believe happened" over a time interval.
type StateViewBuilder ¶
type StateViewBuilder struct {
// contains filtered or unexported fields
}
StateViewBuilder creates StateViews from receipts.
func NewStateViewBuilder ¶
func NewStateViewBuilder(opts ViewOptions) *StateViewBuilder
NewStateViewBuilder creates a new builder with the given options.
func (*StateViewBuilder) Build ¶
func (b *StateViewBuilder) Build(receiptsDir string) (*StateView, error)
Build loads all receipts from the directory and builds a StateView.
func (*StateViewBuilder) BuildFrom ¶
func (b *StateViewBuilder) BuildFrom(graphs []*Graph) *StateView
BuildFrom creates a StateView from the given graphs.
type SubgraphBuilder ¶
type SubgraphBuilder interface {
// BuildSubgraph creates a graph from a manifest file path.
BuildSubgraph(ctx context.Context, manifestPath string, opts BuildOptions) (*Graph, error)
}
SubgraphBuilder builds subgraphs from manifest files during delegate expansion. This is used when a node with operation "delegate" is encountered, causing the referenced manifest to be expanded into a subgraph.
type Summary ¶
type Summary struct {
TotalFiles int `json:"total_files,omitempty" yaml:"total_files,omitempty"`
Links int `json:"links,omitempty" yaml:"links,omitempty"`
Copies int `json:"copies,omitempty" yaml:"copies,omitempty"`
Templates int `json:"templates,omitempty" yaml:"templates,omitempty"`
Secrets int `json:"secrets,omitempty" yaml:"secrets,omitempty"`
Packages int `json:"packages,omitempty" yaml:"packages,omitempty"`
Skipped int `json:"skipped,omitempty" yaml:"skipped,omitempty"`
Failed int `json:"failed,omitempty" yaml:"failed,omitempty"`
BackedUp int `json:"backed_up,omitempty" yaml:"backed_up,omitempty"`
}
Summary contains execution statistics.
type SystemdDisableOp ¶
type SystemdDisableOp struct{}
SystemdDisableOp disables a systemd service at boot (Linux).
func (*SystemdDisableOp) Execute ¶
func (o *SystemdDisableOp) Execute(ctx *Context, node *Node) error
func (*SystemdDisableOp) Name ¶
func (o *SystemdDisableOp) Name() string
type SystemdEnableOp ¶
type SystemdEnableOp struct{}
SystemdEnableOp enables a systemd service at boot (Linux).
func (*SystemdEnableOp) Name ¶
func (o *SystemdEnableOp) Name() string
type SystemdRestartOp ¶
type SystemdRestartOp struct{}
SystemdRestartOp restarts a systemd service (Linux).
func (*SystemdRestartOp) Execute ¶
func (o *SystemdRestartOp) Execute(ctx *Context, node *Node) error
func (*SystemdRestartOp) Name ¶
func (o *SystemdRestartOp) Name() string
type SystemdStartOp ¶
type SystemdStartOp struct{}
SystemdStartOp starts a systemd service (Linux).
func (*SystemdStartOp) Name ¶
func (o *SystemdStartOp) Name() string
type SystemdStopOp ¶
type SystemdStopOp struct{}
SystemdStopOp stops a systemd service (Linux).
func (*SystemdStopOp) Name ¶
func (o *SystemdStopOp) Name() string
type UnlinkOp ¶
type UnlinkOp struct{}
UnlinkOp removes a symlink at node's "path" slot. If ctx.Data["prune_empty_dirs"] is true and ctx.Data["prune_boundary"] is set, empty parent directories are removed up to the boundary.
type ValidateOp ¶
type ValidateOp struct{}
ValidateOp checks a precondition and fails with a message if unmet. The check function is retrieved from ctx.Data["validators"][node's "check" slot].
func (*ValidateOp) Name ¶
func (o *ValidateOp) Name() string
type ViewOptions ¶
type ViewOptions struct {
// Since filters to receipts after this time (zero = no lower bound).
Since time.Time
// Until filters to receipts before this time (zero = no upper bound).
Until time.Time
// Tools filters to specific tools (empty = all tools).
Tools []string
}
ViewOptions configures how the view is built.
type WinServiceDisableOp ¶
type WinServiceDisableOp struct{}
WinServiceDisableOp configures a Windows service to be disabled.
func (*WinServiceDisableOp) Execute ¶
func (o *WinServiceDisableOp) Execute(ctx *Context, node *Node) error
func (*WinServiceDisableOp) Name ¶
func (o *WinServiceDisableOp) Name() string
type WinServiceEnableOp ¶
type WinServiceEnableOp struct{}
WinServiceEnableOp configures a Windows service to start automatically.
func (*WinServiceEnableOp) Execute ¶
func (o *WinServiceEnableOp) Execute(ctx *Context, node *Node) error
func (*WinServiceEnableOp) Name ¶
func (o *WinServiceEnableOp) Name() string
type WinServiceRestartOp ¶
type WinServiceRestartOp struct{}
WinServiceRestartOp restarts a Windows service (stop + start).
func (*WinServiceRestartOp) Execute ¶
func (o *WinServiceRestartOp) Execute(ctx *Context, node *Node) error
func (*WinServiceRestartOp) Name ¶
func (o *WinServiceRestartOp) Name() string
type WinServiceStartOp ¶
type WinServiceStartOp struct{}
WinServiceStartOp starts a Windows service.
func (*WinServiceStartOp) Execute ¶
func (o *WinServiceStartOp) Execute(ctx *Context, node *Node) error
func (*WinServiceStartOp) Name ¶
func (o *WinServiceStartOp) Name() string
type WinServiceStopOp ¶
type WinServiceStopOp struct{}
WinServiceStopOp stops a Windows service.
func (*WinServiceStopOp) Execute ¶
func (o *WinServiceStopOp) Execute(ctx *Context, node *Node) error
func (*WinServiceStopOp) Name ¶
func (o *WinServiceStopOp) Name() string