process

package
v0.194.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0, MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	ID          string
	Command     string
	Description string
	StartedAt   time.Time
	// contains filtered or unexported fields
}

Info holds state for a single tracked background process.

func (*Info) Logs

func (p *Info) Logs() string

Logs returns the retained process output. When the buffer overflowed, the oldest output is gone and the result starts with logTruncatedMarker; the newest output is always retained.

func (*Info) Status

func (p *Info) Status() string

Status returns the current lifecycle state under the same mutex used by the exit and stop paths. Callers outside this package must use this accessor; the field is unexported so an unsynchronized read cannot compile.

type Manager

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

Manager tracks all background processes.

func NewManager

func NewManager() *Manager

NewManager creates a new process manager.

func (*Manager) Get

func (m *Manager) Get(id string) *Info

Get returns a process by ID.

func (*Manager) List

func (m *Manager) List() []*Info

List returns a copy of all tracked processes.

func (*Manager) Start

func (m *Manager) Start(command, description string) (*Info, error)

Start launches a command as a tracked background process.

func (*Manager) Stop

func (m *Manager) Stop(id string) error

Stop terminates a running process.

Jump to

Keyboard shortcuts

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