Documentation
¶
Overview ¶
Package procio is the root package for robust process I/O and signaling primitives.
It provides a platform-agnostic way to handle process execution and terminal input with safety guarantees (like leak-free process termination using Job Objects on Windows and Pdeathsig on Linux).
Subpackages ¶
- proc: Process management and lifecycle guarantees.
- scan: Context-aware parsing of input streams (Scanner).
- termio: Terminal I/O utilities and interruptible readers.
Observability ¶
procio does not depend on any logging library. Instead, it exposes an Observer interface that you can implement to bridge logs and metrics to your preferred system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version string
Functions ¶
func SetObserver ¶
func SetObserver(o Observer)
SetObserver configures the global observer for process events.
Types ¶
type Observer ¶
type Observer interface {
OnProcessStarted(pid int)
OnProcessFailed(err error)
OnIOError(op string, err error)
OnScanError(err error)
LogDebug(msg string, args ...any)
LogWarn(msg string, args ...any)
LogError(msg string, args ...any)
}
Observer allows external packages to plug in observability (logs, metrics) without coupling this module to specific implementations.
func GetObserver ¶
func GetObserver() Observer
GetObserver returns the current global observer. Useful for sub-packages to access the shared observer.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
command
|
|
|
composition
command
|
|
|
interruptible
command
|
|
|
observer
command
|
|
|
pty
command
|
|
|
Package proc provides platform-agnostic process management with safety guarantees.
|
Package proc provides platform-agnostic process management with safety guarantees. |
|
Package pty provides pseudo-terminal (PTY) primitives for running interactive applications within child processes.
|
Package pty provides pseudo-terminal (PTY) primitives for running interactive applications within child processes. |
|
Package scan provides a robust, context-aware command and line scanner.
|
Package scan provides a robust, context-aware command and line scanner. |
|
Package termio provides interruptible I/O primitives and terminal handling.
|
Package termio provides interruptible I/O primitives and terminal handling. |