Skip to main content

Crate keyhog_sources

Crate keyhog_sources 

Source
Expand description

Pluggable input sources for KeyHog.

Each source implements the keyhog_core::Source trait and yields keyhog_core::Chunk values for the scanner. Sources are gated behind cargo features so only the transitive dependencies you actually need are compiled.

Modules§

reqwest
Local HTTP compatibility shim backed by reqwest. Only present when at least one feature that pulls in reqwest is enabled — otherwise this module would pub use reqwest::* against a crate that wasn’t compiled in, which fails resolution on stable rustc (especially on Windows where --no-default-features is the release profile we ship for the no-Hyperscan build).
strings
Printable string extraction from binary data. Shared by the filesystem source (auto-detection) and binary source (explicit).

Structs§

FilesystemSource
Scans files in a directory tree.
GitDiffSource
Scans only the ADDED lines between two git refs. Uses git diff unified diff output and extracts lines starting with ‘+’. Useful for CI/CD pre-commit hooks and PR checks.
GitHistorySource
Scans git history commit-by-commit using patch output and extracts added lines.
GitSource
Scans git history: traverses commits and extracts text blob contents.
StdinSource
Reads all of stdin as a single chunk.
WebSource
Web content source that fetches JavaScript, source maps, and WASM from URLs.

Functions§

create_source
Create a source instance from a name and optional parameters. This allows the CLI to remain agnostic of specific source implementations.
register_plugins
Register all compiled-in source plugins into the global registry. This allows the CLI to discover sources like slack or s3 via the generic --source flag without hardcoded logic in the main crate.