Documentation
¶
Overview ¶
Package core implements the core pipeline functions for dodot. It provides the main execution flow from pack discovery through to filesystem operations.
Index ¶
- Variables
- func CalculateActionChecksum(action types.Action) (string, error)
- func ConvertAction(action types.Action) ([]types.Operation, error)
- func ConvertActionWithContext(action types.Action, ctx *ExecutionContext) ([]types.Operation, error)
- func ConvertActionsToOperations(actions []types.Action) ([]types.Operation, error)
- func ConvertActionsToOperationsWithContext(actions []types.Action, ctx *ExecutionContext) ([]types.Operation, error)
- func FilterRunOnceActions(actions []types.Action, force bool, pathsInstance *paths.Paths) ([]types.Action, error)
- func GetActions(matches []types.TriggerMatch) ([]types.Action, error)
- func GetFiringTriggers(packs []types.Pack) ([]types.TriggerMatch, error)
- func ProcessMatchGroup(matches []types.TriggerMatch) ([]types.Action, error)
- func ProcessPackTriggers(pack types.Pack) ([]types.TriggerMatch, error)
- func ResolveConflicts(ops *[]types.Operation, ctx *ExecutionContext)
- func ShouldRunOnceAction(action types.Action, force bool, pathsInstance *paths.Paths) (bool, error)
- type ExecutionContext
- type OperationResult
- type PackTemplateFile
- type RunOnceStatus
Constants ¶
This section is empty.
Variables ¶
var ( GetPackCandidates = packs.GetPackCandidates GetPacks = packs.GetPacks ValidatePack = packs.ValidatePack SelectPacks = packs.SelectPacks )
Re-exports from pkg/packs for backwards compatibility
Functions ¶
func CalculateActionChecksum ¶
CalculateActionChecksum calculates the checksum for an action's source file. This is used to update the checksum metadata for run-once actions.
func ConvertAction ¶
ConvertAction converts a single action to one or more operations DEPRECATED: Use ConvertActionWithContext instead.
func ConvertActionWithContext ¶
func ConvertActionWithContext(action types.Action, ctx *ExecutionContext) ([]types.Operation, error)
ConvertActionWithContext converts a single action to one or more operations with execution context
func ConvertActionsToOperations ¶ added in v0.1.1
ConvertActionsToOperations converts actions into file system operations This is the planning phase - no actual file system changes are made. DEPRECATED: Use ConvertActionsToOperationsWithContext instead.
func ConvertActionsToOperationsWithContext ¶ added in v0.1.1
func ConvertActionsToOperationsWithContext(actions []types.Action, ctx *ExecutionContext) ([]types.Operation, error)
ConvertActionsToOperationsWithContext converts actions into file system operations with execution context This is the planning phase - no actual file system changes are made.
func FilterRunOnceActions ¶
func FilterRunOnceActions(actions []types.Action, force bool, pathsInstance *paths.Paths) ([]types.Action, error)
FilterRunOnceActions filters a list of actions based on their run-once status. It removes actions that have already been executed with the same checksum, unless the force flag is set.
func GetActions ¶
func GetActions(matches []types.TriggerMatch) ([]types.Action, error)
GetActions converts trigger matches into concrete actions to perform
func GetFiringTriggers ¶
func GetFiringTriggers(packs []types.Pack) ([]types.TriggerMatch, error)
GetFiringTriggers processes packs and returns all triggers that match files
func ProcessMatchGroup ¶
func ProcessMatchGroup(matches []types.TriggerMatch) ([]types.Action, error)
ProcessMatchGroup processes a group of related matches with the same power-up
func ProcessPackTriggers ¶
func ProcessPackTriggers(pack types.Pack) ([]types.TriggerMatch, error)
ProcessPackTriggers processes triggers for a single pack
func ResolveConflicts ¶ added in v0.1.1
func ResolveConflicts(ops *[]types.Operation, ctx *ExecutionContext)
ResolveConflicts checks for and marks conflicting operations This is a wrapper to maintain backward compatibility with ExecutionContext
func ShouldRunOnceAction ¶
ShouldRunOnceAction checks if a run-once action should be executed based on its sentinel file and checksum. Returns true if the action should run, false if it has already run with the same checksum.
Types ¶
type ExecutionContext ¶
type ExecutionContext struct {
ChecksumResults map[string]string // Maps file path to checksum
Force bool // Whether to force operations
Paths *paths.Paths // Paths configuration for the execution
// contains filtered or unexported fields
}
ExecutionContext holds results from operation execution
func NewExecutionContext ¶
func NewExecutionContext(force bool, paths *paths.Paths) *ExecutionContext
NewExecutionContext creates a new execution context
func (*ExecutionContext) ExecuteChecksumOperations ¶
func (ctx *ExecutionContext) ExecuteChecksumOperations(operations []types.Operation) ([]OperationResult, error)
ExecuteChecksumOperations executes only checksum operations and stores results
func (*ExecutionContext) GetChecksum ¶
func (ctx *ExecutionContext) GetChecksum(filePath string) (string, bool)
GetChecksum returns the stored checksum for a file path
func (*ExecutionContext) IsForce ¶ added in v0.1.1
func (ctx *ExecutionContext) IsForce() bool
IsForce returns whether force mode is enabled
type OperationResult ¶
type OperationResult struct {
Operation types.Operation
Success bool
Result interface{} // For checksum operations, this contains the checksum string
Error error
}
OperationResult represents the result of executing an operation
type PackTemplateFile ¶ added in v0.1.1
type PackTemplateFile struct {
Filename string // From matcher configuration
Content string // From powerup's GetTemplateContent()
Mode uint32
PowerUpName string
}
PackTemplateFile represents a template file for pack initialization
func GetCompletePackTemplate ¶ added in v0.1.1
func GetCompletePackTemplate(packName string) ([]PackTemplateFile, error)
GetCompletePackTemplate returns all template files available for a pack by iterating through default matchers and getting templates from powerups
func GetMissingTemplateFiles ¶ added in v0.1.1
func GetMissingTemplateFiles(packPath string, packName string) ([]PackTemplateFile, error)
GetMissingTemplateFiles returns template files that don't exist in the given pack directory
type RunOnceStatus ¶
type RunOnceStatus struct {
Executed bool
ExecutedAt time.Time
Checksum string
Changed bool // True if the source file has changed since execution
}
RunOnceStatus represents the execution status of a run-once power-up
func GetRunOnceStatus ¶
func GetRunOnceStatus(packPath, powerUpName string, pathsInstance *paths.Paths) (*RunOnceStatus, error)
GetRunOnceStatus checks the status of a run-once power-up for a specific pack