Skip to main content

Module server_admin

Module server_admin 

Source
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

CommandArgsDescription
METRICSKey count and uptime JSON
CLUSTER_INFOStandalone cluster descriptor
NODESSelf-only node list
STATSByte-accurate size scan (capped at 100 000 keys)
VERIFYIntegrity 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§

AdminArgs
Parsed arguments for an admin command.
BackupMeta
Metadata written to <dir>/meta.bin alongside a backup manifest.
LogEntry
A single entry in the recent-log ring buffer.

Enums§

BackupKind
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 None for 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.