handlers

package
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package handlers implements various handler types that process matched files and generate operations. Handlers are responsible for determining what operations should be performed on matched files.

Index

Constants

This section is empty.

Variables

View Source
var HandlerRegistry = struct {
	// IsConfigurationHandler returns true if the handler manages configuration
	IsConfigurationHandler func(handlerName string) bool

	// IsCodeExecutionHandler returns true if the handler executes arbitrary code
	IsCodeExecutionHandler func(handlerName string) bool

	// GetHandlerCategory returns the category for a handler
	GetHandlerCategory func(handlerName string) operations.HandlerCategory

	// GetConfigurationHandlers returns all configuration handler names
	GetConfigurationHandlers func() []string

	// GetCodeExecutionHandlers returns all code execution handler names
	GetCodeExecutionHandlers func() []string

	// RequiresExecutionOrdering returns true if code execution handlers should run first
	RequiresExecutionOrdering func() bool
}{
	IsConfigurationHandler: func(handlerName string) bool {
		switch handlerName {
		case "symlink", "shell", "path":
			return true
		default:
			return false
		}
	},

	IsCodeExecutionHandler: func(handlerName string) bool {
		switch handlerName {
		case "homebrew", "install":
			return true
		default:
			return false
		}
	},

	GetHandlerCategory: func(handlerName string) operations.HandlerCategory {
		switch handlerName {
		case "symlink", "shell", "path":
			return operations.CategoryConfiguration
		case "homebrew", "install":
			return operations.CategoryCodeExecution
		default:
			return operations.CategoryConfiguration
		}
	},

	GetConfigurationHandlers: func() []string {
		return []string{"symlink", "shell", "path"}
	},

	GetCodeExecutionHandlers: func() []string {
		return []string{"homebrew", "install"}
	},

	RequiresExecutionOrdering: func() bool {

		return true
	},
}

HandlerRegistry provides a minimal API for handler categorization This replaces the need for RunMode throughout the codebase

Functions

func Initialize

func Initialize() error

Initialize sets up the handler system by: 1. Importing handler packages to register their factories 2. Initializing configuration 3. Setting up any other handler components

This function should be called at application startup before using any handlers functionality.

func MustInitialize

func MustInitialize()

MustInitialize initializes the handler system and panics on error

Types

This section is empty.

Directories

Path Synopsis
lib
homebrew
Package homebrew provides the BrewHandler implementation for dodot.
Package homebrew provides the BrewHandler implementation for dodot.
install
Package install provides the ProvisionScriptHandler implementation for dodot.
Package install provides the ProvisionScriptHandler implementation for dodot.
path
Package path provides the PathHandler implementation for dodot.
Package path provides the PathHandler implementation for dodot.
shell
Package shell provides the ShellProfileHandler implementation for dodot.
Package shell provides the ShellProfileHandler implementation for dodot.
symlink
Package symlink provides the SymlinkHandler implementation for dodot.
Package symlink provides the SymlinkHandler implementation for dodot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL