Core Infra API
Infrastructure interfaces and implementations.
Executor Interface
Section titled “Executor Interface”type Executor interface { Run(cmd string, args ...string) error RunWithOutput(cmd string, args ...string) (string, error) RunInDir(dir, cmd string, args ...string) error RunAsync(cmd string, args ...string) (chan error, error)}Abstracts command execution.
Implementations
Section titled “Implementations”ShellExecutor: Real shell executionMockExecutor: For testing
FileSystem Interface
Section titled “FileSystem Interface”type FileSystem interface { ReadFile(path string) ([]byte, error) WriteFile(path string, data []byte) error Exists(path string) bool MkdirAll(path string) error RemoveAll(path string) error // ... more methods}Abstracts file operations.
Implementations
Section titled “Implementations”OSFileSystem: Real OS operationsMockFileSystem: In-memory for tests
Homebrew Package
Section titled “Homebrew Package”Resolver
Section titled “Resolver”type Resolver struct{}
func NewResolver() *Resolverfunc (r *Resolver) IsInstalled(formula string) boolfunc (r *Resolver) Install(formula string) errorManages Homebrew dependencies.
Infra provides pluggable implementations, allowing domain logic to be tested with mocks.