Expand description
Admin command handler for AmateRS network layer.
This module provides the admin command infrastructure that backs the
__admin__:<CMD> key-intercept protocol in the gRPC server. Admin
commands arrive as ordinary GET queries with a specially-prefixed key, which
lets the CLI reach server-side admin functionality without a dedicated RPC
method.
§Commands
| Command | Args | Description |
|---|---|---|
| METRICS | — | Key count and uptime JSON |
| CLUSTER_INFO | — | Standalone cluster descriptor |
| NODES | — | Self-only node list |
| STATS | — | Byte-accurate size scan (capped at 100 000 keys) |
| VERIFY | — | Integrity check (always reports 0 corruption for MemoryStorage) |
| COMPACT | [<collection>] | Flush storage and return status |
| LOGS | <lines=20> <follow=false> | Return ring-buffered log entries |
| BACKUP | <dir> <full|incremental> | Serialize all keys to <dir>/ |
| RESTORE | <dir> | Replay keys from a previous backup |
Structs§
- Admin
Args - Parsed arguments for an admin command.
- Backup
Meta - Metadata written to
<dir>/meta.binalongside a backup manifest. - LogEntry
- A single entry in the recent-log ring buffer.
Enums§
- Backup
Kind - Whether a backup should capture the full dataset or only incremental changes.
Constants§
- LOG_
RING_ CAPACITY - Capacity of the recent-log ring buffer.
Functions§
- handle_
admin_ command - Execute an admin command and return a JSON string, or
Nonefor unknown commands. - parse_
admin_ args - Parse the argument string that follows an admin command name.
- push_
log_ entry - Push a log entry to the ring buffer, enforcing the 256-entry capacity bound.