Skip to main content

Crate neumann_server

Crate neumann_server 

Source
Expand description

Neumann gRPC Server

This crate provides a gRPC server that exposes the Neumann database via the QueryRouter. It supports:

  • Query execution with streaming results
  • Blob storage with streaming upload/download
  • Health checks for service monitoring
  • Optional TLS and API key authentication

§Example

use neumann_server::{NeumannServer, ServerConfig};
use query_router::QueryRouter;
use std::sync::Arc;
use parking_lot::RwLock;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let router = Arc::new(RwLock::new(QueryRouter::new()));
    let config = ServerConfig::default();

    let server = NeumannServer::new(router, config);
    server.serve().await?;
    Ok(())
}

Re-exports§

pub use audit::AuditConfig;
pub use audit::AuditEntry;
pub use audit::AuditEvent;
pub use audit::AuditLogger;
pub use config::AuthConfig;
pub use config::ClusterConfig;
pub use config::ServerConfig;
pub use config::TlsConfig;
pub use correlation::extract_or_generate;
pub use correlation::request_span;
pub use correlation::RequestSpan;
pub use correlation::TRACE_ID_HEADER;
pub use error::sanitize_error;
pub use error::sanitize_internal_error;
pub use error::Result;
pub use error::ServerError;
pub use memory::MemoryBudgetConfig;
pub use memory::MemoryTracker;
pub use metrics::init_metrics;
pub use metrics::MetricsConfig;
pub use metrics::MetricsHandle;
pub use metrics::ServerMetrics;
pub use rate_limit::Operation;
pub use rate_limit::RateLimitConfig;
pub use rate_limit::RateLimiter;
pub use rest::RestConfig;
pub use rest::VectorApiContext;
pub use service::BlobServiceImpl;
pub use service::CollectionsServiceImpl;
pub use service::HealthServiceImpl;
pub use service::HealthState;
pub use service::PointsServiceImpl;
pub use service::QueryServiceImpl;
pub use shutdown::ShutdownConfig;
pub use shutdown::ShutdownManager;
pub use tls_loader::TlsLoader;
pub use web::AdminContext;
pub use web::NavItem;

Modules§

audit
Audit logging for server events.
auth
Authentication middleware for API key validation.
config
Server configuration types.
convert
Conversion between Neumann types and protobuf messages.
correlation
Request correlation and trace ID propagation.
error
Error types for the Neumann gRPC server.
gamification
Gamification system for the Neumann admin UI.
memory
Memory budget tracking for server resource management.
metrics
OpenTelemetry metrics integration.
proto
Generated protobuf types.
rate_limit
Rate limiting for server operations.
rest
REST API for vector operations.
service
gRPC service implementations.
shutdown
Graceful shutdown manager with drain timeout.
signals
Unix signal handlers for the server.
tls_loader
Reloadable TLS configuration.
web
Web UI for Neumann Server administration.

Structs§

NeumannServer
The main Neumann gRPC server.