Documentation
¶
Index ¶
- type ManageInput
- type ManagePipeline
- type ManagePipelineOpts
- type Pipeline
- func Compose[A, B, C any](p1 Pipeline[A, B], p2 Pipeline[B, C]) Pipeline[A, C]
- func Filter[A any](pred func(A) bool) Pipeline[A, A]
- func FlatMap[A, B any](fn func(A) domain.Result[B]) Pipeline[A, B]
- func Map[A, B any](fn func(A) B) Pipeline[A, B]
- func Parallel[A, B any](pipelines []Pipeline[A, B]) Pipeline[A, []B]
- func PlanStage() Pipeline[PlanInput, planner.DesiredState]
- func ResolveStage() Pipeline[ResolveInput, planner.ResolveResult]
- func ScanStage() Pipeline[ScanInput, []domain.Package]
- func SortStage() Pipeline[SortInput, []domain.Operation]
- type PlanInput
- type ResolveInput
- type ScanInput
- type SortInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ManageInput ¶
type ManageInput struct {
PackageDir domain.PackagePath
TargetDir domain.TargetPath
Packages []string
}
ManageInput contains the input for manage operations
type ManagePipeline ¶
type ManagePipeline struct {
// contains filtered or unexported fields
}
ManagePipeline implements the complete manage workflow. It composes scanning, planning, resolution, and sorting stages.
func NewManagePipeline ¶
func NewManagePipeline(opts ManagePipelineOpts) *ManagePipeline
NewManagePipeline creates a new Manage pipeline with the given options.
func (*ManagePipeline) Execute ¶
func (p *ManagePipeline) Execute(ctx context.Context, input ManageInput) domain.Result[domain.Plan]
Execute runs the complete manage pipeline. It performs: scan packages -> compute desired state -> resolve conflicts -> sort operations
type ManagePipelineOpts ¶
type ManagePipelineOpts struct {
FS domain.FS
IgnoreSet *ignore.IgnoreSet
ScanConfig scanner.ScanConfig
Policies planner.ResolutionPolicies
BackupDir string
PackageNameMapping bool
}
ManagePipelineOpts contains options for the Manage pipeline
type Pipeline ¶
Pipeline represents a functional pipeline stage that transforms input A to output B. Pipelines are pure functions that can be composed to build complex workflows. All operations are context-aware for cancellation and timeout support.
func Compose ¶
Compose combines two pipeline stages sequentially. The output of the first pipeline becomes the input to the second. If the first pipeline fails, the second is not executed. This implements the monadic bind operation for pipelines.
func Filter ¶
Filter creates a pipeline that only passes values matching a predicate. Values that don't match the predicate result in an error.
func FlatMap ¶
FlatMap lifts a Result-returning function into a pipeline stage. This is useful for functions that can fail but don't need context.
func Map ¶
Map lifts a pure function into a pipeline stage. The function is applied to the input value, transforming it to the output type. Since the function cannot fail, the pipeline always succeeds.
func Parallel ¶
Parallel executes multiple pipelines concurrently with the same input. All pipelines receive the same input value and execute in parallel. Returns a slice of results in the same order as the input pipelines. If any pipeline fails, the entire operation fails with the first error encountered.
func PlanStage ¶
func PlanStage() Pipeline[PlanInput, planner.DesiredState]
PlanStage creates a pipeline stage that computes desired state. Takes scanned packages and computes what links should exist.
func ResolveStage ¶
func ResolveStage() Pipeline[ResolveInput, planner.ResolveResult]
ResolveStage creates a pipeline stage that resolves conflicts. Takes desired state and current filesystem state to generate operations.
type PlanInput ¶
type PlanInput struct {
Packages []domain.Package
TargetDir domain.TargetPath
PackageNameMapping bool
}
PlanInput contains the input for planning operations
type ResolveInput ¶
type ResolveInput struct {
Desired planner.DesiredState
TargetDir domain.TargetPath
FS domain.FS
Policies planner.ResolutionPolicies
BackupDir string
}
ResolveInput contains the input for conflict resolution
type ScanInput ¶
type ScanInput struct {
PackageDir domain.PackagePath
TargetDir domain.TargetPath
Packages []string
IgnoreSet *ignore.IgnoreSet
ScanConfig scanner.ScanConfig
FS domain.FS
}
ScanInput contains the input for scanning packages