Documentation
¶
Index ¶
- func HandleStaleState(ctx context.Context, appDir string, dockerMgr docker.RuntimeContainerManager, ...) error
- func LoadStateForCommand(appDir string) (*devstate.DevState, error)
- func StopFromState(ctx context.Context, appDir string, dockerMgr docker.RuntimeContainerManager, ...) error
- type HandlerWatcher
- type Orchestrator
- func (o *Orchestrator) DumpLogs(ctx context.Context) string
- func (o *Orchestrator) RunDetached(ctx context.Context) error
- func (o *Orchestrator) RunForeground(ctx context.Context) error
- func (o *Orchestrator) Shutdown(ctx context.Context) error
- func (o *Orchestrator) ShutdownFromState(ctx context.Context, state *devstate.DevState) error
- func (o *Orchestrator) StartFull(ctx context.Context) error
- func (o *Orchestrator) StartInfraOnly(ctx context.Context) error
- type OrchestratorConfig
- type Output
- func (o *Output) PrintDetachedNotice()
- func (o *Output) PrintError(message string, err error)
- func (o *Output) PrintHealthReady(elapsed time.Duration)
- func (o *Output) PrintHealthWaiting()
- func (o *Output) PrintInfo(message string)
- func (o *Output) PrintLogLine(line devlogs.LogLine)
- func (o *Output) PrintNoEnvironment()
- func (o *Output) PrintProgress(message string)
- func (o *Output) PrintShutdownComplete()
- func (o *Output) PrintShutdownStarting()
- func (o *Output) PrintStartupSummary(port string, handlers []blueprint.HandlerInfo)
- func (o *Output) PrintStatus(state *devstate.DevState, isRunning bool)
- func (o *Output) PrintStep(message string)
- func (o *Output) PrintStreamingNotice()
- func (o *Output) PrintTestFailed(exitCode int)
- func (o *Output) PrintTestHeader(suites []string)
- func (o *Output) PrintTestPassed()
- func (o *Output) PrintWarning(message string, err error)
- func (o *Output) Writer() io.Writer
- type WatcherConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleStaleState ¶
func HandleStaleState( ctx context.Context, appDir string, dockerMgr docker.RuntimeContainerManager, composeMgr *compose.ComposeManager, output *Output, ) error
HandleStaleState checks for a stale state file and cleans up if needed. Returns an error if an active dev environment is already running.
func LoadStateForCommand ¶
LoadStateForCommand loads the state file and validates it for companion commands. Returns the state and an error if not found or stale.
func StopFromState ¶
func StopFromState( ctx context.Context, appDir string, dockerMgr docker.RuntimeContainerManager, composeMgr *compose.ComposeManager, output *Output, logger *zap.Logger, ) error
StopFromState loads the state file and shuts down the environment. Used by `dev stop`.
Types ¶
type HandlerWatcher ¶
type HandlerWatcher struct {
// contains filtered or unexported fields
}
HandlerWatcher watches the source directory for handler changes and restarts the container when structural changes are detected.
func NewHandlerWatcher ¶
func NewHandlerWatcher(config WatcherConfig, initialManifest *preprocess.HandlerManifest) *HandlerWatcher
NewHandlerWatcher creates a new file watcher.
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator manages the full dev run lifecycle.
func NewOrchestrator ¶
func NewOrchestrator( config OrchestratorConfig, dockerMgr docker.RuntimeContainerManager, composeMgr *compose.ComposeManager, extractor *preprocess.Extractor, output *Output, logger *zap.Logger, ) *Orchestrator
NewOrchestrator creates a new dev run orchestrator.
func (*Orchestrator) DumpLogs ¶
func (o *Orchestrator) DumpLogs(ctx context.Context) string
DumpLogs syncs all container logs to files in .celerity/logs/ before teardown. This is called by `dev test` so logs are preserved after the environment is torn down. Returns the log directory path, or empty string if no logs were written.
func (*Orchestrator) RunDetached ¶
func (o *Orchestrator) RunDetached(ctx context.Context) error
RunDetached starts the dev environment and exits, leaving containers running.
func (*Orchestrator) RunForeground ¶
func (o *Orchestrator) RunForeground(ctx context.Context) error
RunForeground starts the dev environment and streams logs until interrupted.
func (*Orchestrator) Shutdown ¶
func (o *Orchestrator) Shutdown(ctx context.Context) error
Shutdown stops the container, compose stack, and removes the state file. Shared between foreground Ctrl+C and the `dev stop` command.
func (*Orchestrator) ShutdownFromState ¶
ShutdownFromState cleans up using a loaded state (for `dev stop`).
func (*Orchestrator) StartFull ¶
func (o *Orchestrator) StartFull(ctx context.Context) error
StartFull runs the full startup sequence (dependencies, seeding, container) and writes state. Used by dev test when API tests are included.
func (*Orchestrator) StartInfraOnly ¶
func (o *Orchestrator) StartInfraOnly(ctx context.Context) error
StartInfraOnly runs compose dependencies, seeds config/data, and applies SQL schemas, but does NOT start the app container. Used by dev test when only integration tests are requested.
type OrchestratorConfig ¶
type OrchestratorConfig struct {
AppDir string
Port string
ServiceName string
Image string
DeployTarget string
Runtime string
MergedBlueprintPath string
ModulePath string
SeedDir string
ConfigDir string
SecretsDir string
Blueprint *schema.Blueprint
SpecFormat schema.SpecFormat
HandlerInfos []blueprint.HandlerInfo
Manifest *preprocess.HandlerManifest
ContainerCfg *docker.ContainerConfig
ComposeCfg *compose.ComposeConfig
}
OrchestratorConfig holds all resolved configuration for a dev run.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output handles all formatted stdout for the dev commands.
func (*Output) PrintDetachedNotice ¶
func (o *Output) PrintDetachedNotice()
PrintDetachedNotice prints the background mode notice.
func (*Output) PrintError ¶
PrintError prints a failed step with a red X and error detail.
func (*Output) PrintHealthReady ¶
PrintHealthReady prints a success message when the app is healthy.
func (*Output) PrintHealthWaiting ¶
func (o *Output) PrintHealthWaiting()
PrintHealthWaiting prints a progress message while waiting for the app.
func (*Output) PrintLogLine ¶
PrintLogLine formats and prints a parsed log line.
func (*Output) PrintNoEnvironment ¶
func (o *Output) PrintNoEnvironment()
PrintNoEnvironment prints a message when no dev environment is running.
func (*Output) PrintProgress ¶
PrintProgress prints an in-progress message for feedback during slow operations.
func (*Output) PrintShutdownComplete ¶
func (o *Output) PrintShutdownComplete()
PrintShutdownComplete prints the shutdown completion message.
func (*Output) PrintShutdownStarting ¶
func (o *Output) PrintShutdownStarting()
PrintShutdownStarting prints the shutdown notice.
func (*Output) PrintStartupSummary ¶
func (o *Output) PrintStartupSummary(port string, handlers []blueprint.HandlerInfo)
PrintStartupSummary prints the URL and handler table after a successful startup.
func (*Output) PrintStatus ¶
PrintStatus renders the status table for `dev status`.
func (*Output) PrintStreamingNotice ¶
func (o *Output) PrintStreamingNotice()
PrintStreamingNotice prints the streaming notice for foreground mode.
func (*Output) PrintTestFailed ¶
PrintTestFailed prints the failure message with the exit code.
func (*Output) PrintTestHeader ¶
PrintTestHeader prints the test run header with the suites being executed.
func (*Output) PrintTestPassed ¶
func (o *Output) PrintTestPassed()
PrintTestPassed prints the success message after all tests pass.
func (*Output) PrintWarning ¶
PrintWarning prints a warning with a yellow exclamation mark.
type WatcherConfig ¶
type WatcherConfig struct {
AppDir string
Runtime string
Extractor *preprocess.Extractor
Blueprint *schema.Blueprint
SpecFormat schema.SpecFormat
Docker docker.RuntimeContainerManager
ContainerID string
Output *Output
Logger *zap.Logger
}
WatcherConfig holds the dependencies for the file watcher.