Documentation
¶
Index ¶
- Constants
- func PublishAction(pub message.Publisher, req ActionRequest) error
- func PublishStreamStart(pub message.Publisher, req StreamStartRequest) error
- func PublishStreamStop(pub message.Publisher, req StreamStopRequest) error
- func RegisterDomainToUITransformer(bus *Bus)
- func RegisterUIActionRunner(tuiCtx context.Context, bus *Bus, opts RootOptions)
- func RegisterUIForwarder(bus *Bus, p *tea.Program)
- func RegisterUIStreamRunner(tuiCtx context.Context, bus *Bus, opts RootOptions)
- type ActionKind
- type ActionLog
- type ActionRequest
- type ActionRequestMsg
- type Bus
- type ConfigPatch
- type Envelope
- type EventLogAppendMsg
- type EventLogEntry
- type HealthCheckResult
- type HealthStatus
- type LogLevel
- type NavigateBackMsg
- type NavigateToServiceMsg
- type PipelineBuildResult
- type PipelineBuildResultMsg
- type PipelineConfigPatches
- type PipelineConfigPatchesMsg
- type PipelineLaunchPlan
- type PipelineLaunchPlanMsg
- type PipelineLiveOutput
- type PipelineLiveOutputMsg
- type PipelinePhase
- type PipelinePhaseFinished
- type PipelinePhaseFinishedMsg
- type PipelinePhaseStarted
- type PipelinePhaseStartedMsg
- type PipelinePrepareResult
- type PipelinePrepareResultMsg
- type PipelineRunFinished
- type PipelineRunFinishedMsg
- type PipelineRunStarted
- type PipelineRunStartedMsg
- type PipelineStepProgressMsg
- type PipelineStepResult
- type PipelineValidateResult
- type PipelineValidateResultMsg
- type PluginIntrospectionRefreshMsg
- type PluginSummary
- type RootOptions
- type ServiceExitObserved
- type StateSnapshot
- type StateSnapshotMsg
- type StateWatcher
- type StreamEnded
- type StreamEndedMsg
- type StreamEvent
- type StreamEventMsg
- type StreamStartRequest
- type StreamStartRequestMsg
- type StreamStarted
- type StreamStartedMsg
- type StreamStopRequest
- type StreamStopRequestMsg
Constants ¶
const ( TopicDevctlEvents = "devctl.events" TopicUIMessages = "devctl.ui.msgs" TopicUIActions = "devctl.ui.actions" )
const ( DomainTypeStateSnapshot = "state.snapshot" DomainTypeServiceExit = "service.exit.observed" DomainTypeActionLog = "action.log" DomainTypePipelineRunStarted = "pipeline.run.started" DomainTypePipelineRunFinished = "pipeline.run.finished" DomainTypePipelinePhaseStarted = "pipeline.phase.started" DomainTypePipelinePhaseFinished = "pipeline.phase.finished" DomainTypePipelineBuildResult = "pipeline.build.result" DomainTypePipelinePrepareResult = "pipeline.prepare.result" DomainTypePipelineValidateResult = "pipeline.validate.result" DomainTypePipelineLaunchPlan = "pipeline.launch.plan" DomainTypeStreamStarted = "stream.started" DomainTypeStreamEvent = "stream.event" DomainTypeStreamEnded = "stream.ended" )
const ( UITypeStateSnapshot = "tui.state.snapshot" UITypeEventAppend = "tui.event.append" UITypeActionRequest = "tui.action.request" UITypePipelineRunStarted = "tui.pipeline.run.started" UITypePipelineRunFinished = "tui.pipeline.run.finished" UITypePipelinePhaseStarted = "tui.pipeline.phase.started" UITypePipelinePhaseFinished = "tui.pipeline.phase.finished" UITypePipelineBuildResult = "tui.pipeline.build.result" UITypePipelinePrepareResult = "tui.pipeline.prepare.result" UITypePipelineValidateResult = "tui.pipeline.validate.result" UITypePipelineLaunchPlan = "tui.pipeline.launch.plan" UITypeStreamStartRequest = "tui.stream.start" UITypeStreamStopRequest = "tui.stream.stop" UITypeStreamStarted = "tui.stream.started" UITypeStreamEvent = "tui.stream.event" UITypeStreamEnded = "tui.stream.ended" )
Variables ¶
This section is empty.
Functions ¶
func PublishAction ¶
func PublishAction(pub message.Publisher, req ActionRequest) error
func PublishStreamStart ¶
func PublishStreamStart(pub message.Publisher, req StreamStartRequest) error
func PublishStreamStop ¶
func PublishStreamStop(pub message.Publisher, req StreamStopRequest) error
func RegisterDomainToUITransformer ¶
func RegisterDomainToUITransformer(bus *Bus)
func RegisterUIActionRunner ¶
func RegisterUIActionRunner(tuiCtx context.Context, bus *Bus, opts RootOptions)
func RegisterUIForwarder ¶
func RegisterUIStreamRunner ¶
func RegisterUIStreamRunner(tuiCtx context.Context, bus *Bus, opts RootOptions)
Types ¶
type ActionKind ¶
type ActionKind string
const ( ActionUp ActionKind = "up" ActionDown ActionKind = "down" ActionRestart ActionKind = "restart" ActionStop ActionKind = "stop" // Stop a specific service )
type ActionRequest ¶
type ActionRequest struct {
Kind ActionKind `json:"kind"`
At time.Time `json:"at"`
Service string `json:"service,omitempty"` // Optional: target specific service
}
type ActionRequestMsg ¶
type ActionRequestMsg struct {
Request ActionRequest
}
type Bus ¶
type Bus struct {
Router *message.Router
Publisher message.Publisher
Subscriber message.Subscriber
// contains filtered or unexported fields
}
func NewInMemoryBus ¶
func (*Bus) AddHandler ¶
type ConfigPatch ¶
type ConfigPatch struct {
Plugin string `json:"plugin"`
Key string `json:"key"` // dotted path, e.g., "services.backend.port"
Value string `json:"value"` // string representation of the value
}
ConfigPatch represents a configuration mutation applied by a plugin.
type Envelope ¶
type Envelope struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload,omitempty"`
}
func (Envelope) MarshalJSONBytes ¶
type EventLogAppendMsg ¶
type EventLogAppendMsg struct {
Entry EventLogEntry
}
type EventLogEntry ¶
type HealthCheckResult ¶
type HealthCheckResult struct {
ServiceName string `json:"service_name"`
Status HealthStatus `json:"status"`
LastCheck time.Time `json:"last_check"`
CheckType string `json:"check_type,omitempty"` // "tcp", "http", "exec"
Endpoint string `json:"endpoint,omitempty"` // e.g., "http://localhost:8080/health"
Error string `json:"error,omitempty"`
ResponseMs int64 `json:"response_ms,omitempty"`
}
HealthCheckResult contains the result of a service health check.
type HealthStatus ¶
type HealthStatus string
HealthStatus represents the health check status of a service.
const ( HealthUnknown HealthStatus = "unknown" HealthHealthy HealthStatus = "healthy" HealthUnhealthy HealthStatus = "unhealthy" )
type NavigateBackMsg ¶
type NavigateBackMsg struct{}
type NavigateToServiceMsg ¶
type NavigateToServiceMsg struct {
}
type PipelineBuildResult ¶
type PipelineBuildResultMsg ¶
type PipelineBuildResultMsg struct {
Result PipelineBuildResult
}
type PipelineConfigPatches ¶
type PipelineConfigPatches struct {
RunID string `json:"run_id"`
Patches []ConfigPatch `json:"patches"`
}
PipelineConfigPatches represents config patches applied during a pipeline run.
type PipelineConfigPatchesMsg ¶
type PipelineConfigPatchesMsg struct {
Patches PipelineConfigPatches
}
PipelineConfigPatchesMsg carries config patches applied during a pipeline run.
type PipelineLaunchPlan ¶
type PipelineLaunchPlanMsg ¶
type PipelineLaunchPlanMsg struct {
Plan PipelineLaunchPlan
}
type PipelineLiveOutput ¶
type PipelineLiveOutput struct {
RunID string `json:"run_id"`
Source string `json:"source"` // step name
Line string `json:"line"`
Stream string `json:"stream"` // "stdout" or "stderr"
}
PipelineLiveOutput represents a line of live output from a build step.
type PipelineLiveOutputMsg ¶
type PipelineLiveOutputMsg struct {
Output PipelineLiveOutput
}
PipelineLiveOutputMsg carries a line of live output from a build step.
type PipelinePhase ¶
type PipelinePhase string
const ( PipelinePhaseMutateConfig PipelinePhase = "mutate_config" PipelinePhaseBuild PipelinePhase = "build" PipelinePhasePrepare PipelinePhase = "prepare" PipelinePhaseValidate PipelinePhase = "validate" PipelinePhaseLaunchPlan PipelinePhase = "launch_plan" PipelinePhaseSupervise PipelinePhase = "supervise" PipelinePhaseStateSave PipelinePhase = "state_save" PipelinePhaseStopSupervise PipelinePhase = "stop_supervise" PipelinePhaseRemoveState PipelinePhase = "remove_state" )
type PipelinePhaseFinished ¶
type PipelinePhaseFinishedMsg ¶
type PipelinePhaseFinishedMsg struct {
Event PipelinePhaseFinished
}
type PipelinePhaseStarted ¶
type PipelinePhaseStarted struct {
RunID string `json:"run_id"`
Phase PipelinePhase `json:"phase"`
At time.Time `json:"at"`
}
type PipelinePhaseStartedMsg ¶
type PipelinePhaseStartedMsg struct {
Event PipelinePhaseStarted
}
type PipelinePrepareResult ¶
type PipelinePrepareResultMsg ¶
type PipelinePrepareResultMsg struct {
Result PipelinePrepareResult
}
type PipelineRunFinished ¶
type PipelineRunFinishedMsg ¶
type PipelineRunFinishedMsg struct {
Run PipelineRunFinished
}
type PipelineRunStarted ¶
type PipelineRunStarted struct {
RunID string `json:"run_id"`
Kind ActionKind `json:"kind"`
RepoRoot string `json:"repo_root"`
At time.Time `json:"at"`
Phases []PipelinePhase `json:"phases,omitempty"`
}
type PipelineRunStartedMsg ¶
type PipelineRunStartedMsg struct {
Run PipelineRunStarted
}
type PipelineStepProgressMsg ¶
type PipelineStepProgressMsg struct {
RunID string `json:"run_id"`
Step string `json:"step"`
Percent int `json:"percent"` // 0-100
}
PipelineStepProgressMsg carries progress updates for a running step.
type PipelineStepResult ¶
type PipelineValidateResult ¶
type PipelineValidateResultMsg ¶
type PipelineValidateResultMsg struct {
Result PipelineValidateResult
}
type PluginIntrospectionRefreshMsg ¶
type PluginIntrospectionRefreshMsg struct{}
type PluginSummary ¶
type PluginSummary struct {
ID string `json:"id"`
Path string `json:"path"`
Priority int `json:"priority"`
Status string `json:"status"` // "active" | "disabled" | "error"
Protocol string `json:"protocol,omitempty"`
Ops []string `json:"ops,omitempty"`
Streams []string `json:"streams,omitempty"`
Commands []string `json:"commands,omitempty"`
CapStatus string `json:"cap_status,omitempty"` // "unknown" | "introspecting" | "ok" | "error"
CapError string `json:"cap_error,omitempty"`
CapStart time.Time `json:"cap_start,omitempty"`
CapEnd time.Time `json:"cap_end,omitempty"`
}
PluginSummary contains summary information about a plugin.
type RootOptions ¶
type ServiceExitObserved ¶
type StateSnapshot ¶
type StateSnapshot struct {
RepoRoot string `json:"repo_root"`
At time.Time `json:"at"`
Exists bool `json:"exists"`
State *state.State `json:"state,omitempty"`
Alive map[string]bool `json:"alive,omitempty"`
Error string `json:"error,omitempty"`
ProcessStats map[int]*proc.Stats `json:"process_stats,omitempty"` // PID -> stats
Health map[string]*HealthCheckResult `json:"health,omitempty"` // service name -> health
Plugins []PluginSummary `json:"plugins,omitempty"` // Plugin summaries
}
type StateSnapshotMsg ¶
type StateSnapshotMsg struct {
Snapshot StateSnapshot
}
type StateWatcher ¶
type StateWatcher struct {
RepoRoot string
Interval time.Duration
Pub message.Publisher
// contains filtered or unexported fields
}
func (*StateWatcher) RequestIntrospection ¶
func (w *StateWatcher) RequestIntrospection()
type StreamEnded ¶
type StreamEndedMsg ¶
type StreamEndedMsg struct {
End StreamEnded
}
type StreamEvent ¶
type StreamEventMsg ¶
type StreamEventMsg struct {
Event StreamEvent
}
type StreamStartRequest ¶
type StreamStartRequestMsg ¶
type StreamStartRequestMsg struct {
Request StreamStartRequest
}
type StreamStarted ¶
type StreamStarted struct {
StreamKey string `json:"stream_key"`
PluginID string `json:"plugin_id"`
Op string `json:"op"`
StreamID string `json:"stream_id"` // protocol stream_id
At time.Time `json:"at"`
}
StreamKey is a local identifier ("plugin/op/hash(input)") and is NOT the protocol stream_id.
type StreamStartedMsg ¶
type StreamStartedMsg struct {
Stream StreamStarted
}
type StreamStopRequest ¶
type StreamStopRequest struct {
StreamKey string `json:"stream_key"`
}
type StreamStopRequestMsg ¶
type StreamStopRequestMsg struct {
Request StreamStopRequest
}