Something went wrong. Try again.
forked from bgpkit/monocle
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101//! Lens module//!//! This module provides high-level "lens" abstractions that combine business logic//! with output formatting. Lenses are designed to be reusable across different//! interfaces (CLI, REST API, HTTP/SSE, GUI).//!//! # Feature Requirements//!//! All lenses require the `lib` feature to be enabled.//!//! **Quick Guide:**//! - Need the CLI binary? Use `cli` feature (includes everything)//! - Need HTTP/SSE server without CLI? Use `server` feature (includes lib)//! - Need only library/data access? Use `lib` feature (this module)//!//! | Lens | Description | Dependencies |//! |------|-------------|--------------|//! | `TimeLens` | Time parsing and formatting | chrono, dateparser |//! | `CountryLens` | Country code/name lookup | bgpkit-commons |//! | `IpLens` | IP information lookup | ipnet, bgpkit-commons |//! | `ParseLens` | MRT file parsing | bgpkit-parser |//! | `SearchLens` | BGP message search | bgpkit-broker, bgpkit-parser, rayon |//! | `RpkiLens` | RPKI validation and data | bgpkit-commons |//! | `Pfx2asLens` | Prefix-to-ASN mapping | bgpkit-commons, oneio |//! | `As2relLens` | AS-level relationships | database |//! | `InspectLens` | Unified AS/prefix lookup | All above |//!//! # Architecture//!//! Each lens module exports://! - A **Lens struct** (e.g., `RpkiLens`, `TimeLens`) - the main entry point for all operations//! - **Args structs** - input arguments for lens methods//! - **Output types** - return types and format enums//!//! Internal implementation details (helper functions, data loading, API calls) are kept//! private within each lens module. External users should only interact through the lens.//!//! # Usage//!//! All lens operations should be performed through the lens struct. Import the//! specific lens module you need://!//! ```rust,ignore//! // Time parsing//! use monocle::lens::time::{TimeLens, TimeParseArgs, TimeOutputFormat};//!//! // RPKI validation//! use monocle::lens::rpki::{RpkiLens, RpkiValidationArgs, RpkiListArgs, RpkiRoaEntry};//!//! // IP information//! use monocle::lens::ip::{IpLens, IpLookupArgs, IpInfo};//!//! // Unified AS/prefix inspection//! use monocle::lens::inspect::{InspectLens, InspectQueryOptions};//! ```
// =============================================================================// All lenses (require lib feature)// =============================================================================
// TimeLens - time parsing and formatting#[cfg(feature = "lib")]pub mod time;
// CountryLens - country code/name lookup using bgpkit-commons#[cfg(feature = "lib")]pub mod country;
// IpLens - IP information lookup#[cfg(feature = "lib")]pub mod ip;
// ParseLens - MRT file parsing with bgpkit-parser#[cfg(feature = "lib")]pub mod parse;
// SearchLens - BGP message search across MRT files#[cfg(feature = "lib")]pub mod search;
// RibLens - arbitrary timestamp RIB reconstruction#[cfg(feature = "lib")]pub mod rib;
// RpkiLens - RPKI validation and data#[cfg(feature = "lib")]pub mod rpki;
// Pfx2asLens - prefix-to-ASN mapping#[cfg(feature = "lib")]pub mod pfx2as;
// As2relLens - AS-level relationships#[cfg(feature = "lib")]pub mod as2rel;
// InspectLens - unified AS and prefix information lookup#[cfg(feature = "lib")]pub mod inspect;pub mod watch;