Expand description
Haystack HTTP API server with SCRAM auth, WebSocket watches, and federation.
Provides HaystackServer — an Actix Web-based HTTP server implementing
the full Project Haystack REST API with 30+ standard operations.
§Features
- 30+ Haystack ops — about, read, nav, hisRead, hisWrite, pointWrite, watchSub, watchPoll, watchUnsub, invokeAction, defs, libs, formats, and more
- SCRAM SHA-256 auth — Token-based authentication with configurable TTL
- WebSocket watches — Real-time entity change subscriptions with compression
- Federation — Hub-and-spoke topology with automatic entity routing, delta sync, and adaptive intervals
- History store — In-memory time-series storage for his-tagged points
- Content negotiation — Zinc, JSON, JSON v3, CSV via Accept header
§Quick Start
use haystack_core::graph::{EntityGraph, SharedGraph};
use haystack_server::HaystackServer;
let graph = SharedGraph::new(EntityGraph::new());
HaystackServer::new(graph)
.port(8080)
.host("0.0.0.0")
.run()
.awaitRe-exports§
pub use app::HaystackServer;pub use domain_scope::DomainScope;pub use federation::Federation;
Modules§
- actions
- Action registry for the
invokeActionop. - app
- Server builder and startup.
- auth
- Server-side authentication manager using SCRAM SHA-256.
- connector
- Connector for fetching entities from a remote Haystack server.
- content
- Content negotiation — parse Accept header to pick codec, decode request body.
- demo
- domain_
scope - Domain scoping for federated queries.
- error
- Haystack error grids and Actix Web error integration.
- federation
- Federation manager — coordinates multiple remote connectors for federated queries.
- his_
store - In-memory time-series store for historical data (hisRead / hisWrite).
- ops
- Haystack HTTP API op handlers and route registration.
- session
- state
- Application state shared across all request handlers.
- ws
- WebSocket handler and watch subscription manager.