Documentation
¶
Index ¶
- Variables
- func CheckDependencies() error
- func FindDevContainerFile(dir string) (string, bool, 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 ValidateAccount(account string) error
- func ValidateImage(image string) error
- func ValidateProvider(provider string) error
- type Build
- type Customizations
- type DevContainerConfig
- type MountPoint
- type PortMapping
- type ProviderInfo
- type ReactorCustomizations
- type ResolvedConfig
- type Service
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 FindDevContainerFile ¶ added in v1.1.0
FindDevContainerFile searches for devcontainer.json in the specified directory Search order: .devcontainer/devcontainer.json, then .devcontainer.json
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 ValidateAccount ¶
ValidateAccount validates that the account name is valid for filesystem use
func ValidateImage ¶
ValidateImage validates that the image specification is valid
func ValidateProvider ¶
ValidateProvider validates that the provider name is supported
Types ¶
type Customizations ¶ added in v1.1.0
type Customizations struct {
Reactor *ReactorCustomizations `json:"reactor"`
}
Customizations block for tool-specific settings
type DevContainerConfig ¶ added in v1.1.0
type DevContainerConfig struct {
Name string `json:"name"`
Image string `json:"image"`
Build *Build `json:"build"`
ForwardPorts []interface{} `json:"forwardPorts"` // Can be int or string "host:container"
RemoteUser string `json:"remoteUser"`
PostCreateCommand interface{} `json:"postCreateCommand"`
Customizations *Customizations `json:"customizations"`
}
DevContainerConfig represents the structure of a devcontainer.json file
func LoadDevContainerConfig ¶ added in v1.1.0
func LoadDevContainerConfig(filePath string) (*DevContainerConfig, error)
LoadDevContainerConfig loads and parses a devcontainer.json file
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 PortMapping ¶ added in v1.1.0
type PortMapping struct {
HostPort int // port on host machine
ContainerPort int // port inside container
}
PortMapping defines a port forwarding configuration
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 ReactorCustomizations ¶ added in v1.1.0
type ReactorCustomizations struct {
Account string `json:"account"`
DefaultCommand string `json:"defaultCommand"`
}
ReactorCustomizations defines reactor-specific settings
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>/
ForwardPorts []PortMapping // port forwarding from devcontainer.json
RemoteUser string // container user from devcontainer.json
Build *Build // Docker build configuration from devcontainer.json
PostCreateCommand interface{} // post-creation command from devcontainer.json (string or []string)
DefaultCommand string // default command from reactor customizations
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 NewServiceWithRoot ¶ added in v1.1.0
NewServiceWithRoot creates a new configuration service with a specific project root
func (*Service) InitializeProject ¶
InitializeProject creates a basic devcontainer.json template
func (*Service) ListAccounts ¶
ListAccounts scans ~/.reactor/ for existing accounts
func (*Service) ResolveConfiguration ¶ added in v1.1.0
func (s *Service) ResolveConfiguration() (*ResolvedConfig, error)
ResolveConfiguration loads and resolves configuration using the new devcontainer.json workflow
func (*Service) ShowConfiguration ¶
ShowConfiguration displays the current devcontainer configuration