//! Prelude module for convenient wildcard imports.
//!
//! ```rust
//! use sunbeam_g2v::prelude::*;
//! ```

pub use crate::config::{
    AuthConfig, DatabaseConfig, ElectionConfig, LimitsConfig, NatsConfig, ObservabilityConfig,
    ServiceConfig, VaultConfig,
};
pub use crate::error::{ServiceError, ServiceResult};
pub use crate::router::ServiceRouter;
pub use crate::server::{ServerConfig, axum::AxumServer, builder::ServerBuilder};
pub use crate::service::{ServiceExt, SunbeamService};

pub use crate::db::Database;
pub use crate::election::{ElectionError, LeaderElection, LeaderHandle};
pub use crate::testing::TestHarness;

// Re-export connectrpc essentials
pub use buffa::view::{MessageView, OwnedView};
pub use connectrpc::{ConnectError, ErrorCode, RequestContext, Router};

// Re-export common types
pub use http::{HeaderMap, HeaderName, HeaderValue};
pub use std::sync::Arc;
pub use std::time::Duration;
pub use tower::{Layer, Service};

/// Common result type for fallible operations in Sunbeam services.
///
/// Defaults to [`ServiceError`] as the error type.
pub type Result<T, E = ServiceError> = std::result::Result<T, E>;
