Documentation
¶
Index ¶
- Variables
- func CheckDependencies() error
- func GenerateProjectHash(projectRoot string) string
- func GetProjectConfigPath() string
- func GetReactorHomeDir() (string, error)
- func GetSystemUsername() (string, error)
- func ResolveImage(projectImage, providerDefault, cliImage string) string
- func SaveProjectConfig(config *ProjectConfig, configPath string) error
- func ValidateAccount(account string) error
- func ValidateImage(image string) error
- func ValidateProjectConfig(config *ProjectConfig) error
- func ValidateProvider(provider string) error
- type MountPoint
- type ProjectConfig
- type ProviderInfo
- type ResolvedConfig
- type Service
- func (s *Service) GetConfigValue(key string) (interface{}, error)
- func (s *Service) InitializeProject() error
- func (s *Service) ListAccounts() error
- func (s *Service) LoadConfiguration(cliProvider, cliAccount, cliImage string, cliDanger bool) (*ResolvedConfig, error)
- func (s *Service) SetConfigValue(key, value string) error
- func (s *Service) ShowConfiguration() error
Constants ¶
This section is empty.
Variables ¶
var BuiltinImages = map[string]string{
"base": "ghcr.io/dyluth/reactor/base:latest",
"python": "ghcr.io/dyluth/reactor/python:latest",
"node": "ghcr.io/dyluth/reactor/node:latest",
"go": "ghcr.io/dyluth/reactor/go:latest",
}
Built-in image mappings for convenience
var BuiltinProviders = map[string]ProviderInfo{ "claude": { Name: "claude", DefaultImage: "ghcr.io/dyluth/reactor/base:latest", Mounts: []MountPoint{ {Source: "claude", Target: "/home/claude/.claude"}, }, }, "gemini": { Name: "gemini", DefaultImage: "ghcr.io/dyluth/reactor/base:latest", Mounts: []MountPoint{ {Source: "gemini", Target: "/home/claude/.gemini"}, }, }, }
Built-in provider mappings (hardcoded but extensible)
Functions ¶
func CheckDependencies ¶
func CheckDependencies() error
CheckDependencies verifies that required system dependencies are available
func GenerateProjectHash ¶
GenerateProjectHash creates a consistent hash for the project directory This is used to isolate configurations between different projects for the same account
func GetProjectConfigPath ¶
func GetProjectConfigPath() string
GetProjectConfigPath returns the path to the project configuration file with optional isolation prefix
func GetReactorHomeDir ¶
GetReactorHomeDir returns the reactor configuration directory path with optional isolation prefix
func GetSystemUsername ¶
GetSystemUsername returns the current system username as default account
func ResolveImage ¶
ResolveImage determines the final container image to use based on precedence: CLI override > project config > provider default
func SaveProjectConfig ¶
func SaveProjectConfig(config *ProjectConfig, configPath string) error
SaveProjectConfig saves a ProjectConfig to the specified path
func ValidateAccount ¶
ValidateAccount validates that the account name is valid for filesystem use
func ValidateImage ¶
ValidateImage validates that the image specification is valid
func ValidateProjectConfig ¶
func ValidateProjectConfig(config *ProjectConfig) error
ValidateProjectConfig validates a ProjectConfig struct
func ValidateProvider ¶
ValidateProvider validates that the provider name is supported
Types ¶
type MountPoint ¶
type MountPoint struct {
Source string // subdirectory under ~/.reactor/<account>/<project-hash>/
Target string // path in container
}
MountPoint defines a directory mount for providers
type ProjectConfig ¶
type ProjectConfig struct {
Provider string `yaml:"provider"` // claude, gemini, or custom
Account string `yaml:"account"` // account name for isolation
Image string `yaml:"image"` // base, python, go, or custom image URL
Danger bool `yaml:"danger,omitempty"` // enable dangerous permissions
}
ProjectConfig represents the project-level configuration stored in .reactor.conf
func CreateDefaultProjectConfig ¶
func CreateDefaultProjectConfig() (*ProjectConfig, error)
CreateDefaultProjectConfig creates a ProjectConfig with sensible defaults
func LoadProjectConfig ¶
func LoadProjectConfig(configPath string) (*ProjectConfig, error)
LoadProjectConfig loads and parses the .reactor.conf file
type ProviderInfo ¶
type ProviderInfo struct {
Name string // claude, gemini
DefaultImage string // suggested default image
Mounts []MountPoint // multiple mount points for this provider
}
ProviderInfo defines built-in provider configuration
type ResolvedConfig ¶
type ResolvedConfig struct {
Provider ProviderInfo
Account string
Image string
ProjectRoot string
ProjectHash string // first 8 chars of project path hash
AccountConfigDir string // ~/.reactor/<account>/
ProjectConfigDir string // ~/.reactor/<account>/<project-hash>/
Danger bool
}
ResolvedConfig contains fully resolved configuration with all paths
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles configuration operations
func (*Service) GetConfigValue ¶
GetConfigValue retrieves a configuration value by key
func (*Service) InitializeProject ¶
InitializeProject creates a new .reactor.conf with defaults and sets up directories
func (*Service) ListAccounts ¶
ListAccounts scans ~/.reactor/ for existing accounts
func (*Service) LoadConfiguration ¶
func (s *Service) LoadConfiguration(cliProvider, cliAccount, cliImage string, cliDanger bool) (*ResolvedConfig, error)
LoadConfiguration loads and resolves the complete configuration
func (*Service) SetConfigValue ¶
SetConfigValue sets a configuration value by key
func (*Service) ShowConfiguration ¶
ShowConfiguration displays the current configuration with directory paths