haystack_server/lib.rs
1//! Haystack HTTP API server with SCRAM auth and WebSocket watches.
2//!
3//! Provides [`HaystackServer`] — an Axum-based HTTP server implementing
4//! the full Project Haystack REST API with 30+ standard operations.
5//!
6//! ## Features
7//!
8//! - **30+ Haystack ops** — about, read, nav, hisRead, hisWrite, pointWrite,
9//! watchSub, watchPoll, watchUnsub, invokeAction, defs, libs, formats, and more
10//! - **SCRAM SHA-256 auth** — Token-based authentication with configurable TTL
11//! - **WebSocket watches** — Real-time entity change subscriptions
12//! - **History store** — In-memory time-series storage for his-tagged points
13//! - **Content negotiation** — Zinc, JSON, JSON v3, CSV via Accept header
14//!
15//! ## Quick Start
16//!
17//! ```rust,no_run
18//! use haystack_core::graph::{EntityGraph, SharedGraph};
19//! use haystack_server::HaystackServer;
20//!
21//! # async fn example() -> std::io::Result<()> {
22//! let graph = SharedGraph::new(EntityGraph::new());
23//! HaystackServer::new(graph)
24//! .port(8080)
25//! .host("0.0.0.0")
26//! .run()
27//! .await
28//! # }
29//! ```
30
31pub mod actions;
32pub mod app;
33pub mod auth;
34pub mod content;
35pub mod demo;
36pub mod error;
37pub mod his_provider;
38pub mod his_store;
39pub mod ops;
40pub mod state;
41pub mod ws;
42
43pub use app::HaystackServer;
44pub use his_provider::HistoryProvider;