Skip to main content

obz_core/
lib.rs

1//! obz-core: Core framework for the obz observability CLI.
2//!
3//! This crate provides everything needed to build obz providers and
4//! applications:
5//!
6//! - [`model`] — Unified data models and response envelope
7//! - [`provider`] — Provider trait definitions (params, results, traits)
8//! - [`descriptor`] — Extension command and flag descriptors (clap-ready)
9//! - [`registry`] — Runtime provider catalog (`ProviderRegistry`)
10//! - [`execute`] — Core command execution functions
11//! - [`time`] — Time expression parser (now-1h, RFC3339, Unix timestamps)
12//! - [`output`] — Output formatting pipeline (JSON, Table, CSV)
13//! - [`cmd_path`] — Standard command identifiers for provider `command_flags` declarations
14
15pub mod cmd_path;
16pub mod descriptor;
17pub mod execute;
18pub mod model;
19pub mod output;
20pub mod provider;
21pub mod registry;
22pub mod time;
23
24// Re-export common types at the crate root.
25pub use cmd_path::StandardCommand;
26pub use descriptor::{CommandDescriptor, FlagDescriptor, FlagType};
27pub use model::error::{ErrorCategory, ErrorCode, ErrorDetail, ObzError};
28pub use model::log::{LogEntry, Severity};
29pub use model::metric::{DataPoint, MetricInfoDetail, MetricSeries, MetricType, SeriesStats};
30pub use model::response::{
31    ExtensionData, LabelValuesData, LogSearchData, MetricInfoData, MetricQueryData, QueryMetadata,
32    Response, ResponseStatus, ScalarData, SeriesListData, StringListData, TimeRange,
33    TraceDetailData, TraceSearchData,
34};
35pub use model::trace::{Span, SpanEvent, SpanKind, SpanStatus, TraceDetail};
36pub use provider::{
37    auth_missing_error, is_sensitive_key, ExtensionParams, ExtensionProvider, ExtensionResult,
38    ProviderConfig, Signal,
39};
40pub use registry::{
41    BuiltProvider, ProviderFactory, ProviderMeta, ProviderRegistry, SupportedCommands,
42};