Skip to main content

Crate shardline

Crate shardline 

Source
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§

report_output

Structs§

BenchConfig
Benchmark execution parameters.
BenchReport
Aggregate benchmark report.
ByteMetrics
Byte-count measurements for a single benchmark iteration.
ChunkMetrics
Chunk-count measurements for a single benchmark iteration.
CliParseError
CLI parse failure.
GcScheduleInstallOptions
One scheduled-GC systemd installation request.
GcScheduleInstallReport
Summary for a scheduled-GC installation.
GcScheduleUninstallReport
Summary for a scheduled-GC uninstall run.
IngestBenchReport
Aggregate zero-storage ingest benchmark report.
InventoryMetrics
Inventory snapshot at the end of a single benchmark iteration.
LatencyMetrics
Latency measurements for a single benchmark iteration.
ProviderlessSetupReport
Result of bootstrapping providerless source-checkout state.
RedactedDbUrl
Wrapper that redacts sensitive database URLs in Debug output.
RepairReport
Report produced by the top-level repair orchestrator.
TimingMetrics
Process timing measurements for a single benchmark iteration.

Enums§

AdminTokenError
Runtime failure while minting a local admin token.
BackupRuntimeError
Backup command runtime failure.
BenchDeploymentTarget
Supported end-to-end benchmark deployment targets.
BenchInventoryScope
Scope of the inventory counters recorded in the benchmark report.
BenchMode
Supported benchmark modes.
BenchRuntimeError
Benchmark runtime failure.
BenchScenario
Supported benchmark scenarios.
CliArtifactError
CLI artifact generation failure.
CliCommand
Supported Shardline CLI commands.
CliRuntimeError
CLI runtime failure.
CompletionShell
Supported completion targets.
ConfigRuntimeError
Runtime failure while validating configuration.
DbRuntimeError
Database-migration runtime failure.
FsckRuntimeError
Local fsck runtime failure.
GcRuntimeError
Garbage-collection runtime failure.
GcScheduleError
Scheduled-GC helper failure.
HoldRuntimeError
Retention-hold runtime failure.
ProviderlessRuntimeError
Failure while creating or loading providerless source-checkout state.
RebuildRuntimeError
Local index-rebuild runtime failure.
RepairRuntimeError
Local lifecycle-repair runtime failure.
StorageMigrationRuntimeError
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/data convention 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.