core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateContainerName

func GenerateContainerName(account, projectPath, projectHash string) string

GenerateContainerName creates a deterministic container name with project folder name and optional isolation prefix

func GenerateDiscoveryContainerName

func GenerateDiscoveryContainerName(account, projectPath, projectHash string) string

GenerateDiscoveryContainerName creates a unique container name for discovery mode

Types

type ContainerBlueprint

type ContainerBlueprint struct {
	Name         string        // Deterministic container name with isolation support
	Image        string        // Resolved container image
	Command      []string      // Command to run in container
	WorkDir      string        // Working directory in container
	User         string        // Container user (e.g., "claude")
	Environment  []string      // Environment variables
	Mounts       []string      // Volume mounts in "source:target:type" format
	PortMappings []PortMapping // Port forwarding configurations
	NetworkMode  string        // Network configuration
}

ContainerBlueprint defines the complete specification for creating a container

func NewContainerBlueprint

func NewContainerBlueprint(resolved *config.ResolvedConfig, mounts []MountSpec, isDiscovery bool, dockerHostIntegration bool, portMappings []PortMapping) *ContainerBlueprint

NewContainerBlueprint creates a container blueprint from resolved configuration and mounts

func (*ContainerBlueprint) ToContainerSpec

func (b *ContainerBlueprint) ToContainerSpec() *docker.ContainerSpec

ToContainerSpec converts the blueprint to a Docker ContainerSpec

type MountSpec

type MountSpec struct {
	Source string // Host path (absolute)
	Target string // Container path
	Type   string // Mount type ("bind", "volume", etc.)
}

MountSpec defines a container mount specification

type PortMapping

type PortMapping struct {
	HostPort      int
	ContainerPort int
}

PortMapping represents a port forwarding configuration

type StateService

type StateService struct {
	// contains filtered or unexported fields
}

StateService validates existence of state directories and provides mount specifications

func NewStateService

func NewStateService(resolved *config.ResolvedConfig) *StateService

NewStateService creates a new state validation service

func (*StateService) GetAccount

func (s *StateService) GetAccount() string

GetAccount returns the account name from resolved configuration

func (*StateService) GetMounts

func (s *StateService) GetMounts() []MountSpec

GetMounts generates mount specifications for the container Returns mount specifications in Docker bind mount format

func (*StateService) GetProjectHash

func (s *StateService) GetProjectHash() string

GetProjectHash returns the project hash from resolved configuration

func (*StateService) GetProjectRoot

func (s *StateService) GetProjectRoot() string

GetProjectRoot returns the project root directory

func (*StateService) ValidateDirectories

func (s *StateService) ValidateDirectories() error

ValidateDirectories checks that all required state directories exist Returns error if directories are missing, directing user to run `reactor config init`

Jump to

Keyboard shortcuts

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