lifecycle is a Go library for robust infrastructure signaling and interactive I/O. It allows applications to differentiate between "User Interrupts" and "System Terminations" while enforcing leak-free shutdowns.
For a detailed breakdown of the problems we solve (Zombie Processes, Blocking I/O, Dual Signals), see PRODUCT.md.
It is designed to be the foundational entry point for modern Go Applications (Services, Agents, CLIs).
- procio v0.1.2: Process hygiene (PDeathSig, Job Objects) and interactive I/O (
CONIN$on Windows). - introspection v0.1.3: Generic visualization primitives (Mermaid diagram generation).
- TECHNICAL.md: Architecture (Foundation & Control Plane).
- PLANNING.md: Roadmap & Planning.
- PRODUCT.md: Vision and "Why?" (The problem space).
- DECISIONS.md: Design Decisions.
- STATE_MACHINE.md: Worker State Machine.
- CONFIGURATION.md: Configuration Philosophy.
- RECIPES.md: Common Usage Patterns.
- TESTING.md: Testing Philosophy.
- examples/: Runnable recipes (
basic,hooks,interactive_dx,supervisor,suspend).
Ensure dependencies are synced:
go mod tidygo test -timeout 90s -race -v ./...
# or
make testPoweshell needs double quotes for file paths
go test -race -v -timeout 90s -coverprofile="coverage.out" ./...
go tool cover -func="coverage.out"
# or
make coveragego run ./examples/hooks/main.go- Managed Global State: We abstract the inevitable global state (OS Signals) into clean, context-aware usage. Prefer
Contextpropagation, but enjoyDefaultRouterconvenience. - Leak-Free: Every resource (goroutine, file handle) must close on shutdown.
- Platform Agnostic: Windows
CONIN$handling is a first-class citizen, not an afterthought. - Observability: Internal state changes must be visible via
pkg/metricsinterfaces.