Documentation
¶
Index ¶
- Constants
- func DisplayProcessStatus(state ProcessState) string
- type ArgReference
- type DependencyGraph
- type DependencyLink
- type DependencyNode
- type DependsOnConfig
- type DeprecationParams
- type EnvCmd
- type Environment
- type LogRotationConfig
- type LoggerConfig
- type MCPArgument
- type MCPArgumentType
- type MCPProcessConfig
- type MCPProcessType
- type MCPServerConfig
- type MemoryState
- type MonitorFor
- type ProcessCondition
- type ProcessConfig
- func (p *ProcessConfig) AssignProcessExecutableAndArgs(shellConf *command.ShellConfig, elevatedShellArg string)
- func (p *ProcessConfig) CalculateReplicaName() string
- func (p *ProcessConfig) Compare(another *ProcessConfig) bool
- func (p *ProcessConfig) GetDependencies() []string
- func (p *ProcessConfig) IsDeferred() bool
- func (p *ProcessConfig) IsMCP() bool
- func (p *ProcessConfig) IsMCPResource() bool
- func (p *ProcessConfig) IsMCPTool() bool
- func (p *ProcessConfig) ValidateProcessConfig() error
- type ProcessDependency
- type ProcessFunc
- type ProcessPorts
- type ProcessState
- type ProcessStateEvent
- type Processes
- type ProcessesState
- type Project
- func (p *Project) GetDependenciesOrderNames() ([]string, error)
- func (p *Project) GetElevatedShellArg() string
- func (p *Project) GetLexicographicProcessNames() ([]string, error)
- func (p *Project) GetProcesses(names ...string) ([]ProcessConfig, error)
- func (p *Project) WithProcesses(names []string, fn ProcessFunc) error
- type ProjectState
- type RestartPolicy
- type RestartPolicyConfig
- type ScheduleConfig
- type ShutDownParams
- type StateObserver
- type Vars
Constants ¶
const ( ProcessStateDisabled = "Disabled" ProcessStateForeground = "Foreground" ProcessStatePending = "Pending" ProcessStateRunning = "Running" ProcessStateLaunching = "Launching" ProcessStateLaunched = "Launched" ProcessStateRestarting = "Restarting" ProcessStateTerminating = "Terminating" ProcessStateCompleted = "Completed" ProcessStateSkipped = "Skipped" ProcessStateError = "Error" ProcessStateScheduled = "Scheduled" )
const ( ProcessHealthReady = "Ready" ProcessHealthNotReady = "Not Ready" ProcessHealthUnknown = PlaceHolderValue )
const ( ProcessUpdateUpdated = "updated" ProcessUpdateRemoved = "removed" ProcessUpdateAdded = "added" ProcessUpdateError = "error" )
const DefaultLaunchTimeout = 5
const DefaultNamespace = "default"
const PlaceHolderValue = "-"
Variables ¶
This section is empty.
Functions ¶
func DisplayProcessStatus ¶ added in v1.73.0
func DisplayProcessStatus(state ProcessState) string
Display a process status for the UI.
In particular, this displays "Failed" if the process has completed with a non-zero exit code. This makes it clearer when a process has failed, as opposed to exiting successfully.
We can't change the `Status` field to "Failed" directly because that would change the JSON API behavior, but we can change it in the TUI.
Types ¶
type ArgReference ¶ added in v1.94.0
ArgReference represents a found argument reference in a command
func ExtractArgReferences ¶ added in v1.94.0
func ExtractArgReferences(command string) ([]ArgReference, error)
ExtractArgReferences extracts @{...} patterns from a command string Supports @{arg}, @{arg:default}, and escaped \@{arg}
type DependencyGraph ¶ added in v1.87.0
type DependencyGraph struct {
AllNodes map[string]*DependencyNode `json:"-" yaml:"-"`
Nodes map[string]*DependencyNode `json:"nodes" yaml:"nodes"`
}
DependencyGraph represents the full process dependency structure
func BuildDependencyGraph ¶ added in v1.87.0
func BuildDependencyGraph(processes Processes) *DependencyGraph
BuildDependencyGraph constructs a dependency graph from process configurations
func NewDependencyGraph ¶ added in v1.87.0
func NewDependencyGraph() *DependencyGraph
NewDependencyGraph creates an empty dependency graph
func (*DependencyGraph) RebuildInternalIndices ¶ added in v1.87.0
func (g *DependencyGraph) RebuildInternalIndices()
RebuildInternalIndices reconstructs AllNodes from the recursive Nodes map. This is useful on the client side after receiving the graph via JSON/YAML.
func (*DependencyGraph) ToMermaid ¶ added in v1.87.0
func (g *DependencyGraph) ToMermaid() string
ToMermaid outputs the dependency graph in Mermaid flowchart format
type DependencyLink ¶ added in v1.87.0
type DependencyLink struct {
*DependencyNode `yaml:",inline"`
Type string `json:"dependency_type" yaml:"dependency_type"`
}
DependencyLink wraps a node with the dependency condition
type DependencyNode ¶ added in v1.87.0
type DependencyNode struct {
Name string `json:"name" yaml:"name"`
Status string `json:"process_status" yaml:"process_status"`
IsReady string `json:"is_ready" yaml:"is_ready"`
DependsOn map[string]DependencyLink `json:"depends_on,omitempty" yaml:"depends_on,omitempty" swaggertype:"object"`
}
DependencyNode represents a process in the dependency graph
type DeprecationParams ¶
type Environment ¶
type Environment []string
type LogRotationConfig ¶ added in v0.69.0
type LogRotationConfig struct {
// Directory to log to when filelogging is enabled
Directory string `yaml:"directory,omitempty" json:"directory,omitempty"`
// Filename is the name of the logfile which will be placed inside the directory
Filename string `yaml:"filename,omitempty" json:"filename,omitempty"`
// MaxSize the max size in MB of the logfile before it's rolled
MaxSize int `yaml:"max_size_mb,omitempty" json:"maxSize,omitempty"`
// MaxBackups the max number of rolled files to keep
MaxBackups int `yaml:"max_backups,omitempty" json:"maxBackups,omitempty"`
// MaxAge the max age in days to keep a logfile
MaxAge int `yaml:"max_age_days,omitempty" json:"maxAge,omitempty"`
// Compress determines if the rotated log files should be compressed
// using gzip. The default is not to perform compression.
Compress bool `yaml:"compress,omitempty" json:"compress,omitempty"`
}
LogRotationConfig is the configuration for logging
type LoggerConfig ¶ added in v0.69.0
type LoggerConfig struct {
// Rotation is the configuration for logging rotation
Rotation *LogRotationConfig `yaml:"rotation,omitempty" json:"rotation,omitempty"`
// FieldsOrder is the order in which fields are logged
FieldsOrder []string `yaml:"fields_order,omitempty" json:"fieldsOrder,omitempty"`
// DisableJSON disables log JSON formatting
DisableJSON bool `yaml:"disable_json,omitempty" json:"disableJSON,omitempty"`
// TimestampFormat is the format of the timestamp
TimestampFormat string `yaml:"timestamp_format,omitempty" json:"timestampFormat,omitempty"`
// NoColor disables coloring
NoColor bool `yaml:"no_color,omitempty" json:"noColor,omitempty"`
// NoMetadata disables log metadata (process, replica)
NoMetadata bool `yaml:"no_metadata,omitempty" json:"noMetadata,omitempty"`
// AddTimestamp adds timestamp to log
AddTimestamp bool `yaml:"add_timestamp,omitempty" json:"addTimestamp,omitempty"`
// FlushEachLine flushes the logger on each line
FlushEachLine bool `yaml:"flush_each_line,omitempty" json:"flushEachLine,omitempty"`
}
type MCPArgument ¶ added in v1.94.0
type MCPArgument struct {
Name string `yaml:"name"`
Type MCPArgumentType `yaml:"type"`
Description string `yaml:"description,omitempty"`
Required bool `yaml:"required,omitempty"`
Default string `yaml:"default,omitempty"`
}
MCPArgument defines a single argument for an MCP tool
type MCPArgumentType ¶ added in v1.94.0
type MCPArgumentType string
MCPArgumentType represents the type of an MCP argument
const ( MCPArgTypeString MCPArgumentType = "string" MCPArgTypeNumber MCPArgumentType = "number" MCPArgTypeBoolean MCPArgumentType = "boolean" MCPArgTypeInteger MCPArgumentType = "integer" )
func (MCPArgumentType) IsValid ¶ added in v1.94.0
func (t MCPArgumentType) IsValid() bool
IsValid checks if the argument type is valid
type MCPProcessConfig ¶ added in v1.94.0
type MCPProcessConfig struct {
Type MCPProcessType `yaml:"type"`
Arguments []MCPArgument `yaml:"arguments,omitempty"`
Timeout string `yaml:"timeout,omitempty"` // Optional: overrides global timeout
}
MCPProcessConfig defines the MCP-specific configuration for a process
func (*MCPProcessConfig) GetTimeout ¶ added in v1.94.0
func (m *MCPProcessConfig) GetTimeout() (time.Duration, error)
GetTimeout returns the timeout duration for this MCP process Returns 0 if not set (caller should fall back to global timeout)
func (*MCPProcessConfig) IsResource ¶ added in v1.94.0
func (m *MCPProcessConfig) IsResource() bool
IsResource returns true if this is a resource-type process
func (*MCPProcessConfig) IsTool ¶ added in v1.94.0
func (m *MCPProcessConfig) IsTool() bool
IsTool returns true if this is a tool-type process
type MCPProcessType ¶ added in v1.94.0
type MCPProcessType string
MCPProcessType represents the type of MCP process
const ( MCPProcessTypeTool MCPProcessType = "tool" MCPProcessTypeResource MCPProcessType = "resource" )
type MCPServerConfig ¶ added in v1.94.0
type MCPServerConfig struct {
Host string `yaml:"host,omitempty"`
Port int `yaml:"port,omitempty"`
Transport string `yaml:"transport,omitempty"` // Optional: defaults to "sse"
Timeout string `yaml:"timeout,omitempty"` // Optional: defaults to "5m"
ExposeControlTools bool `yaml:"expose_control_tools,omitempty"` // Optional: when true, expose built-in pc_* control tools
}
MCPServerConfig defines the top-level MCP server configuration
func (*MCPServerConfig) GetTimeout ¶ added in v1.94.0
func (m *MCPServerConfig) GetTimeout() (time.Duration, error)
GetTimeout returns the timeout duration for the MCP server Returns 0 if not set (caller should use default)
func (*MCPServerConfig) IsEnabled ¶ added in v1.94.0
func (m *MCPServerConfig) IsEnabled() bool
IsEnabled returns true if MCP server is configured
func (*MCPServerConfig) IsSSE ¶ added in v1.94.0
func (m *MCPServerConfig) IsSSE() bool
IsSSE returns true if transport is sse (or default)
func (*MCPServerConfig) IsStdio ¶ added in v1.94.0
func (m *MCPServerConfig) IsStdio() bool
IsStdio returns true if transport is stdio
func (*MCPServerConfig) Validate ¶ added in v1.94.0
func (m *MCPServerConfig) Validate() error
Validate checks if the MCP server configuration is valid
type MemoryState ¶ added in v0.77.4
type MonitorFor ¶ added in v1.110.0
type MonitorFor int
const ( MonitorForNone MonitorFor = iota // default - no monitoring MonitorForActivity // notify on new output while unfocused MonitorForSilence // notify on no output while unfocused )
func (MonitorFor) MarshalYAML ¶ added in v1.110.0
func (m MonitorFor) MarshalYAML() (interface{}, error)
func (MonitorFor) String ¶ added in v1.110.0
func (i MonitorFor) String() string
func (*MonitorFor) UnmarshalYAML ¶ added in v1.110.0
func (m *MonitorFor) UnmarshalYAML(node *yaml.Node) error
type ProcessCondition ¶ added in v1.64.1
type ProcessCondition int
const ( // ProcessConditionCompleted is the type for waiting until a process has completed (any exit code). ProcessConditionCompleted ProcessCondition = iota // ProcessConditionCompletedSuccessfully is the type for waiting until a process has completed successfully (exit code 0). ProcessConditionCompletedSuccessfully // ProcessConditionHealthy is the type for waiting until a process is healthy. ProcessConditionHealthy // ProcessConditionStarted is the type for waiting until a process has started (default). ProcessConditionStarted // ProcessConditionLogReady is the type for waiting until a process has printed a predefined log line ProcessConditionLogReady )
func (ProcessCondition) MarshalYAML ¶ added in v1.100.0
func (c ProcessCondition) MarshalYAML() (interface{}, error)
func (ProcessCondition) String ¶ added in v1.64.1
func (i ProcessCondition) String() string
func (*ProcessCondition) UnmarshalYAML ¶ added in v1.64.1
func (c *ProcessCondition) UnmarshalYAML(node *yaml.Node) error
type ProcessConfig ¶
type ProcessConfig struct {
Name string `yaml:",omitempty" json:"name,omitempty"`
Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"`
IsDaemon bool `yaml:"is_daemon,omitempty" json:"isDaemon,omitempty"`
Command string `yaml:"command,omitempty" json:"command,omitempty"`
Entrypoint []string `yaml:"entrypoint,omitempty" json:"entrypoint,omitempty"`
LogLocation string `yaml:"log_location,omitempty" json:"logLocation,omitempty"`
LoggerConfig *LoggerConfig `yaml:"log_configuration,omitempty" json:"loggerConfig,omitempty"`
Environment Environment `yaml:"environment,omitempty" json:"environment,omitempty"`
EnvFile string `yaml:"env_file,omitempty" json:"envFile,omitempty"`
RestartPolicy RestartPolicyConfig `yaml:"availability,omitempty" json:"restartPolicy,omitempty"`
DependsOn DependsOnConfig `yaml:"depends_on,omitempty" json:"dependsOn,omitempty"`
LivenessProbe *health.Probe `yaml:"liveness_probe,omitempty" json:"livenessProbe,omitempty"`
ReadinessProbe *health.Probe `yaml:"readiness_probe,omitempty" json:"readinessProbe,omitempty"`
ReadyLogLine string `yaml:"ready_log_line,omitempty" json:"readyLogLine,omitempty"`
ShutDownParams ShutDownParams `yaml:"shutdown,omitempty" json:"shutDownParams,omitempty"`
DisableAnsiColors bool `yaml:"disable_ansi_colors,omitempty" json:"disableAnsiColors,omitempty"`
WorkingDir string `yaml:"working_dir,omitempty" json:"workingDir,omitempty"`
Namespace string `yaml:"namespace,omitempty" json:"namespace,omitempty"`
Replicas int `yaml:"replicas,omitempty" json:"replicas,omitempty"`
Extensions map[string]interface{} `yaml:",inline" json:"extensions,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Vars Vars `yaml:"vars,omitempty" json:"vars,omitempty"`
IsForeground bool `yaml:"is_foreground,omitempty" json:"isForeground,omitempty"`
IsTty bool `yaml:"is_tty,omitempty" json:"isTty,omitempty"`
IsElevated bool `yaml:"is_elevated,omitempty" json:"isElevated,omitempty"`
IsInteractive bool `yaml:"is_interactive,omitempty" json:"isInteractive,omitempty"`
LaunchTimeout int `yaml:"launch_timeout_seconds,omitempty" json:"launchTimeout,omitempty"`
IsDisabled string `yaml:"is_disabled,omitempty" json:"isDisabled,omitempty"`
DisableDotEnv bool `yaml:"is_dotenv_disabled,omitempty" json:"disableDotEnv,omitempty"`
OriginalConfig string `yaml:"original_config,omitempty" json:"originalConfig,omitempty"`
ReplicaNum int `yaml:"replica_num,omitempty" json:"replicaNum,omitempty"`
ReplicaName string `yaml:"replica_name,omitempty" json:"replicaName,omitempty"`
Executable string `yaml:"executable,omitempty" json:"executable,omitempty"`
Args []string `yaml:"args,omitempty" json:"args,omitempty"`
Schedule *ScheduleConfig `yaml:"schedule,omitempty" json:"schedule,omitempty"`
MCP *MCPProcessConfig `yaml:"mcp,omitempty" json:"mcp,omitempty"`
TruncateLog bool `yaml:"truncate_log,omitempty" json:"truncateLog,omitempty"`
DisableCommandRendering bool `yaml:"is_template_disabled,omitempty" json:"disableCommandRendering,omitempty"`
MonitorFor MonitorFor `yaml:"monitor_for,omitempty" json:"monitorFor,omitempty" jsonschema:"type=string,enum=none,enum=activity,enum=silence"`
MonitorSilenceThreshold time.Duration `yaml:"monitor_silence_threshold,omitempty" json:"monitorSilenceThreshold,omitempty"`
}
func (*ProcessConfig) AssignProcessExecutableAndArgs ¶ added in v1.34.0
func (p *ProcessConfig) AssignProcessExecutableAndArgs(shellConf *command.ShellConfig, elevatedShellArg string)
func (*ProcessConfig) CalculateReplicaName ¶ added in v0.55.0
func (p *ProcessConfig) CalculateReplicaName() string
func (*ProcessConfig) Compare ¶ added in v1.27.0
func (p *ProcessConfig) Compare(another *ProcessConfig) bool
Compare returns true if two process configs are equal
func (*ProcessConfig) GetDependencies ¶
func (p *ProcessConfig) GetDependencies() []string
func (*ProcessConfig) IsDeferred ¶ added in v0.77.4
func (p *ProcessConfig) IsDeferred() bool
func (*ProcessConfig) IsMCP ¶ added in v1.94.0
func (p *ProcessConfig) IsMCP() bool
IsMCP returns true if this process is MCP-enabled
func (*ProcessConfig) IsMCPResource ¶ added in v1.94.0
func (p *ProcessConfig) IsMCPResource() bool
IsMCPResource returns true if this is an MCP resource
func (*ProcessConfig) IsMCPTool ¶ added in v1.94.0
func (p *ProcessConfig) IsMCPTool() bool
IsMCPTool returns true if this is an MCP tool
func (*ProcessConfig) ValidateProcessConfig ¶ added in v1.34.0
func (p *ProcessConfig) ValidateProcessConfig() error
type ProcessDependency ¶
type ProcessDependency struct {
Condition ProcessCondition `` /* 193-byte string literal not displayed */
Extensions map[string]interface{} `yaml:",inline" json:"extensions,omitempty"`
}
type ProcessFunc ¶
type ProcessFunc func(process ProcessConfig) error
type ProcessPorts ¶ added in v0.55.0
type ProcessState ¶
type ProcessState struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Status string `json:"status"`
SystemTime string `json:"system_time"`
Age time.Duration `json:"age" swaggertype:"primitive,integer"`
Health string `json:"is_ready"`
HasHealthProbe bool `json:"has_ready_probe"`
Restarts int `json:"restarts"`
ExitCode int `json:"exit_code"`
Pid int `json:"pid"`
IsElevated bool `json:"is_elevated"`
PasswordProvided bool `json:"password_provided"`
Mem int64 `json:"mem"`
CPU float64 `json:"cpu"`
IsRunning bool `json:"is_running"`
NextRunTime *time.Time `json:"next_run_time,omitempty"`
LastActivityTime *time.Time `json:"last_activity_time,omitempty"`
MaxLogicalLine int64 `json:"-"` // TUI-only: furthest logical line reached in terminal
// ProcessStartTime is the wall-clock time the process (first) entered a
// running/launched state. Used by `process-compose analyze critical-chain`.
ProcessStartTime *time.Time `json:"process_start_time,omitempty"`
// ProcessReadyTime is the wall-clock time the process became ready. For
// processes with a readiness probe or a `ready_log_line`, this is set when
// the probe succeeds / the line is observed. For processes without any
// readiness probe, it equals ProcessStartTime.
ProcessReadyTime *time.Time `json:"process_ready_time,omitempty"`
// ProcessEndTime is the wall-clock time the process ended (completed,
// errored, terminated, or was skipped).
ProcessEndTime *time.Time `json:"process_end_time,omitempty"`
}
func NewProcessState ¶ added in v0.55.0
func NewProcessState(proc *ProcessConfig) *ProcessState
func (*ProcessState) IsReady ¶ added in v1.63.0
func (p *ProcessState) IsReady() bool
Check if a process is running and healthy.
If `hasHealthProbe` is true, the process must be healthy to be considered ready.
func (*ProcessState) IsReadyReason ¶ added in v1.63.0
func (p *ProcessState) IsReadyReason() (bool, string)
Check if a process is running and healthy and explain why.
If `hasHealthProbe` is true, the process must be healthy to be considered ready.
The explanation may be empty.
type ProcessStateEvent ¶ added in v1.110.0
type ProcessStateEvent struct {
// Snapshot is true for events emitted as part of the initial replay on
// subscribe, false for live transitions.
Snapshot bool `json:"snapshot,omitempty"`
// State is a self-contained copy of the process state at the moment of
// the event.
State ProcessState `json:"state"`
}
ProcessStateEvent is published whenever a process's observable state (Status, Health, or terminal exit info) changes. It is also emitted as a snapshot for every existing process when a subscriber first connects.
type Processes ¶
type Processes map[string]ProcessConfig
type ProcessesState ¶ added in v0.50.0
type ProcessesState struct {
States []ProcessState `json:"data"`
}
func (*ProcessesState) IsReady ¶ added in v1.63.0
func (p *ProcessesState) IsReady() bool
type Project ¶
type Project struct {
Version string `yaml:",omitempty"`
Name string `yaml:"name,omitempty"`
LogLocation string `yaml:"log_location,omitempty"`
LogLevel string `yaml:"log_level,omitempty"`
LogLength int `yaml:"log_length,omitempty"`
LoggerConfig *LoggerConfig `yaml:"log_configuration,omitempty"`
LogFormat string `yaml:"log_format,omitempty"`
Processes Processes `yaml:"processes"`
Environment Environment `yaml:"environment,omitempty"`
ShellConfig *command.ShellConfig `yaml:"shell,omitempty"`
IsStrict bool `yaml:"is_strict,omitempty"`
Vars Vars `yaml:"vars,omitempty"`
DisableEnvExpansion bool `yaml:"disable_env_expansion,omitempty"`
IsTuiDisabled bool `yaml:"is_tui_disabled,omitempty"`
ExtendsProject string `yaml:"extends,omitempty"`
EnvCommands EnvCmd `yaml:"env_cmds,omitempty"`
IsOrderedShutdown bool `yaml:"ordered_shutdown,omitempty"`
FileNames []string `yaml:"file_names,omitempty"`
EnvFileNames []string `yaml:"env_file_names,omitempty"`
DotEnvVars map[string]string `yaml:"dot_env_vars,omitempty"`
Extensions map[string]any `yaml:",inline"`
MCPServer *MCPServerConfig `yaml:"mcp_server,omitempty"`
}
func (*Project) GetDependenciesOrderNames ¶
func (*Project) GetElevatedShellArg ¶ added in v1.46.0
func (*Project) GetLexicographicProcessNames ¶
func (*Project) GetProcesses ¶ added in v0.75.0
func (p *Project) GetProcesses(names ...string) ([]ProcessConfig, error)
func (*Project) WithProcesses ¶
func (p *Project) WithProcesses(names []string, fn ProcessFunc) error
WithProcesses run ProcessFunc on each Process and dependencies in dependency order
type ProjectState ¶ added in v0.75.0
type ProjectState struct {
FileNames []string `json:"fileNames"`
UpTime time.Duration `json:"upTime" swaggertype:"primitive,integer"`
StartTime time.Time `json:"startTime"`
ProcessNum int `json:"processNum"`
RunningProcessNum int `json:"runningProcessNum"`
UserName string `json:"userName"`
Version string `json:"version"`
ProjectName string `json:"projectName"`
MemoryState *MemoryState `json:"memoryState,omitempty"`
}
type RestartPolicy ¶ added in v1.64.1
type RestartPolicy int
const ( RestartPolicyNo RestartPolicy = iota RestartPolicyAlways RestartPolicyOnFailure RestartPolicyExitOnFailure )
func (RestartPolicy) MarshalYAML ¶ added in v1.100.0
func (p RestartPolicy) MarshalYAML() (interface{}, error)
func (RestartPolicy) String ¶ added in v1.64.1
func (i RestartPolicy) String() string
func (*RestartPolicy) UnmarshalYAML ¶ added in v1.64.1
func (p *RestartPolicy) UnmarshalYAML(node *yaml.Node) error
type RestartPolicyConfig ¶
type RestartPolicyConfig struct {
Restart RestartPolicy `yaml:",omitempty" json:"restart,omitempty" jsonschema:"type=string,enum=always,enum=on_failure,enum=exit_on_failure,enum=no"`
BackoffSeconds int `yaml:"backoff_seconds,omitempty" json:"backoffSeconds,omitempty"`
MaxRestarts int `yaml:"max_restarts,omitempty" json:"maxRestarts,omitempty"`
ExitOnEnd bool `yaml:"exit_on_end,omitempty" json:"exitOnEnd,omitempty"`
ExitOnSkipped bool `yaml:"exit_on_skipped,omitempty" json:"exitOnSkipped,omitempty"`
}
type ScheduleConfig ¶ added in v1.87.0
type ScheduleConfig struct {
// Cron expression for cron-based scheduling (e.g., "0 2 * * *")
Cron string `yaml:"cron,omitempty" json:"cron,omitempty"`
// Timezone for cron expression (e.g., "UTC", "America/New_York")
Timezone string `yaml:"timezone,omitempty" json:"timezone,omitempty"`
// Interval for interval-based scheduling (e.g., "30m", "1h", "5s")
Interval string `yaml:"interval,omitempty" json:"interval,omitempty"`
// RunOnStart determines whether to run immediately when process-compose starts
RunOnStart bool `yaml:"run_on_start,omitempty" json:"run_on_start,omitempty"`
// MaxConcurrent limits concurrent executions (default: 1)
MaxConcurrent int `yaml:"max_concurrent,omitempty" json:"max_concurrent,omitempty"`
}
ScheduleConfig defines the scheduling configuration for a process.
func (*ScheduleConfig) GetIntervalDuration ¶ added in v1.87.0
func (s *ScheduleConfig) GetIntervalDuration() (time.Duration, error)
GetIntervalDuration parses and returns the interval as a duration.
func (*ScheduleConfig) GetMaxConcurrent ¶ added in v1.87.0
func (s *ScheduleConfig) GetMaxConcurrent() int
GetMaxConcurrent returns the max concurrent value, defaulting to 1.
func (*ScheduleConfig) GetTimezone ¶ added in v1.87.0
func (s *ScheduleConfig) GetTimezone() (*time.Location, error)
GetTimezone returns the configured timezone location.
func (*ScheduleConfig) IsScheduled ¶ added in v1.87.0
func (s *ScheduleConfig) IsScheduled() bool
IsScheduled returns true if this config has any scheduling defined.
type ShutDownParams ¶
type ShutDownParams struct {
ShutDownCommand string `yaml:"command,omitempty" json:"shutDownCommand,omitempty"`
ShutDownTimeout int `yaml:"timeout_seconds,omitempty" json:"shutDownTimeout,omitempty"`
Signal int `yaml:"signal,omitempty" json:"signal,omitempty"`
ParentOnly bool `yaml:"parent_only,omitempty" json:"parentOnly,omitempty"`
}
type StateObserver ¶ added in v1.110.0
type StateObserver interface {
// Notify is called for every event delivered to this observer. If the
// observer cannot accept the event (e.g. its buffer is full), it should
// drop or close itself rather than block.
Notify(ev ProcessStateEvent)
// UniqueID identifies this observer for subscribe/unsubscribe.
UniqueID() string
}
StateObserver consumes process state events. Implementations must be safe for concurrent calls; Notify is invoked while the broadcaster's mutex is held, so observers should not block on slow I/O.
The interface lives next to ProcessStateEvent so consumers (api, client, tui) can implement and reference it without importing the heavier app package.