Documentation
¶
Index ¶
- type DeploymentStats
- type Manager
- func (m *Manager) GetLogs(ctx context.Context, deployment *deployments.Deployment, lines int, ...) ([]byte, error)
- func (m *Manager) GetStats(ctx context.Context, deployment *deployments.Deployment, deployPath string) (*DeploymentStats, error)
- func (m *Manager) Restart(ctx context.Context, deployment *deployments.Deployment) error
- func (m *Manager) Start(ctx context.Context, deployment *deployments.Deployment, workDir string) error
- func (m *Manager) Status(ctx context.Context, deployment *deployments.Deployment) (string, error)
- func (m *Manager) Stop(ctx context.Context, deployment *deployments.Deployment) error
- func (m *Manager) WaitForHealthy(ctx context.Context, deployment *deployments.Deployment, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeploymentStats ¶
type DeploymentStats struct {
PID int `json:"pid"`
CPUPercent float64 `json:"cpu_percent"`
MemoryRSS int64 `json:"memory_rss_bytes"`
DiskBytes int64 `json:"disk_bytes"`
UptimeSecs float64 `json:"uptime_seconds"`
}
DeploymentStats holds on-demand resource usage for a deployment process
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages deployment processes via systemd (Linux) or direct process spawning (macOS/other)
func NewManager ¶
NewManager creates a new process manager
func (*Manager) GetLogs ¶
func (m *Manager) GetLogs(ctx context.Context, deployment *deployments.Deployment, lines int, follow bool) ([]byte, error)
GetLogs retrieves logs for a deployment
func (*Manager) GetStats ¶
func (m *Manager) GetStats(ctx context.Context, deployment *deployments.Deployment, deployPath string) (*DeploymentStats, error)
GetStats returns on-demand resource usage stats for a deployment. deployPath is the directory on disk for disk usage calculation.
func (*Manager) Restart ¶
func (m *Manager) Restart(ctx context.Context, deployment *deployments.Deployment) error
Restart restarts a deployment process
func (*Manager) Start ¶
func (m *Manager) Start(ctx context.Context, deployment *deployments.Deployment, workDir string) error
Start starts a deployment process
func (*Manager) Status ¶
func (m *Manager) Status(ctx context.Context, deployment *deployments.Deployment) (string, error)
Status gets the status of a deployment process
func (*Manager) Stop ¶
func (m *Manager) Stop(ctx context.Context, deployment *deployments.Deployment) error
Stop stops a deployment process
func (*Manager) WaitForHealthy ¶
func (m *Manager) WaitForHealthy(ctx context.Context, deployment *deployments.Deployment, timeout time.Duration) error
WaitForHealthy waits for a deployment to become healthy
Click to show internal directories.
Click to hide internal directories.