How th0b1a5/png-cli works
png is a Linux CLI for managing endpoint groups and checking their health over HTTP/S, TCP, or ICMP. The main workflow loads the user's configuration, selects a group, probes its endpoints concurrently, and prints latency and status. The same command handler supports listing, creating, and deleting groups or endpoints, persisting those changes in the JSON config file. The excerpt shows these responsibilities concentrated in main.go; omitted portions limit certainty about some command branches and configuration details.
Main entry points: main.go Command handler
Components 14
CLI and groups
- Command handler
main.go - Group management
main.go - Endpoint management
main.go
Health checks
- Probe dispatch
main.go - HTTP/S probe
main.go - TCP probe
main.go - ICMP probe
main.go - Status output
main.go
Configuration
- JSON configuration
main.go - Config path
main.go
Other components
- CLI user
- HTTP endpoints
- TCP endpoints
- ICMP targets
Connections 15
- CLI user → Command handler: runs
main.go - Command handler → JSON configuration: loads
main.go - Command handler → Group management: dispatches
main.go - Command handler → Endpoint management: dispatches
main.go - Group management → JSON configuration: updates
main.go - Endpoint management → JSON configuration: updates
main.go - Command handler → Probe dispatch: pings group
main.go - Probe dispatch → HTTP/S probe: checks HTTP/S
main.go - Probe dispatch → TCP probe: checks TCP
main.go - Probe dispatch → ICMP probe: checks ICMP
main.go - HTTP/S probe → HTTP endpoints: sends request
main.go - TCP probe → TCP endpoints: dials
main.go - ICMP probe → ICMP targets: pings
main.go - Probe dispatch → Status output: prints result
main.go - Config path → JSON configuration: locates
main.go