Expand description
Library surface behind the shardline command-line entry point.
The binary target is intentionally thin: it delegates parsing, artifact
generation, configuration loading, and operator workflows to this crate. That
keeps command behavior testable and lets integration tests exercise the same
code paths as the installed shardline executable.
The most commonly embedded pieces are CliCommand for parsing, render_manpage
and render_completion for packaging artifacts, and run_providerless_setup
for bootstrapping a local host deployment.
§Example
use shardline::{CliCommand, CompletionShell, render_completion};
let command = CliCommand::parse(["shardline", "config", "check"])?;
assert!(matches!(command, CliCommand::ConfigCheck));
let completion = render_completion(CompletionShell::Bash)?;
assert!(completion.contains("shardline"));Modules§
Structs§
- Bench
Config - Benchmark execution parameters.
- Bench
Report - Aggregate benchmark report.
- Byte
Metrics - Byte-count measurements for a single benchmark iteration.
- Chunk
Metrics - Chunk-count measurements for a single benchmark iteration.
- CliParse
Error - CLI parse failure.
- GcSchedule
Install Options - One scheduled-GC systemd installation request.
- GcSchedule
Install Report - Summary for a scheduled-GC installation.
- GcSchedule
Uninstall Report - Summary for a scheduled-GC uninstall run.
- Ingest
Bench Report - Aggregate zero-storage ingest benchmark report.
- Inventory
Metrics - Inventory snapshot at the end of a single benchmark iteration.
- Latency
Metrics - Latency measurements for a single benchmark iteration.
- Providerless
Setup Report - Result of bootstrapping providerless source-checkout state.
- Redacted
DbUrl - Wrapper that redacts sensitive database URLs in Debug output.
- Repair
Report - Report produced by the top-level repair orchestrator.
- Timing
Metrics - Process timing measurements for a single benchmark iteration.
Enums§
- Admin
Token Error - Runtime failure while minting a local admin token.
- Backup
Runtime Error - Backup command runtime failure.
- Bench
Deployment Target - Supported end-to-end benchmark deployment targets.
- Bench
Inventory Scope - Scope of the inventory counters recorded in the benchmark report.
- Bench
Mode - Supported benchmark modes.
- Bench
Runtime Error - Benchmark runtime failure.
- Bench
Scenario - Supported benchmark scenarios.
- CliArtifact
Error - CLI artifact generation failure.
- CliCommand
- Supported Shardline CLI commands.
- CliRuntime
Error - CLI runtime failure.
- Completion
Shell - Supported completion targets.
- Config
Runtime Error - Runtime failure while validating configuration.
- DbRuntime
Error - Database-migration runtime failure.
- Fsck
Runtime Error - Local fsck runtime failure.
- GcRuntime
Error - Garbage-collection runtime failure.
- GcSchedule
Error - Scheduled-GC helper failure.
- Hold
Runtime Error - Retention-hold runtime failure.
- Providerless
Runtime Error - Failure while creating or loading providerless source-checkout state.
- Rebuild
Runtime Error - Local index-rebuild runtime failure.
- Repair
Runtime Error - Local lifecycle-repair runtime failure.
- Storage
Migration Runtime Error - Storage-migration runtime failure.
Functions§
- effective_
root - Resolves the effective deployment-root path after applying an optional CLI override.
- install_
gc_ schedule - Installs systemd units for scheduled Shardline garbage collection.
- load_
runtime_ server_ config - Loads the runtime server configuration and automatically bootstraps providerless local
source-checkout state when the active configuration matches the
.shardline/dataconvention and does not already provide a signing key. - load_
server_ config - Loads the active Shardline server configuration and applies an optional deployment-root override.
- mint_
admin_ token - Mints a local bearer token for testing and self-hosted operation.
- mint_
admin_ token_ from_ sources - Mints a local bearer token from either a signing-key file or an environment variable.
- print_
hold_ list_ summary - print_
hold_ summary - render_
completion - Render a shell-completion script into one UTF-8 string.
- render_
manpage - Render the Shardline manpage into one UTF-8 string.
- run_
backup_ manifest - Writes a backup manifest for the active deployment.
- run_
bench - Runs the local sparse-update benchmark suite.
- run_
config_ check_ from_ env - Loads and validates the active Shardline server configuration.
- run_
db_ migration - Runs a Shardline database-migration command.
- run_
fsck - Runs Shardline integrity checks for the active deployment.
- run_gc
- Runs garbage collection against the active Shardline deployment.
- run_
gc_ diagnostics - Runs garbage collection against the active Shardline deployment and returns full diagnostics.
- run_
health_ check - Runs the HTTP health check command.
- run_
hold_ list - Lists retention holds from the configured metadata backend.
- run_
hold_ release - Deletes one retention hold from the configured metadata backend.
- run_
hold_ set - Creates or updates one retention hold.
- run_
index_ rebuild - Rebuilds latest-record state from immutable version records for the active deployment.
- run_
ingest_ bench - Runs the zero-storage upload-ingest benchmark suite.
- run_
lifecycle_ repair - Repairs stale lifecycle metadata for the active Shardline deployment.
- run_
providerless_ setup - Bootstraps local providerless source-checkout state under
.shardline. - run_
repair - Runs the full local repair sequence for the active Shardline deployment.
- run_
storage_ migration - Runs an object-storage migration.
- uninstall_
gc_ schedule - Removes systemd units for scheduled Shardline garbage collection.
- write_
output_ bytes - Writes one local CLI output file through an anchored temporary path.