1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! REST API server for centralized baseline management.
//!
//! This crate provides a REST API server for storing and managing performance
//! baselines. It supports multiple storage backends (in-memory, SQLite, PostgreSQL)
//! and includes authentication via API keys.
//!
//! Part of the [perfgate](https://github.com/EffortlessMetrics/perfgate) workspace.
//!
//! # Features
//!
//! - **Multi-tenancy**: Projects/namespaces for isolation
//! - **Version history**: Track baseline versions over time
//! - **Rich metadata**: Git refs, tags, custom metadata
//! - **Access control**: Role-based permissions (Viewer, Contributor, Promoter, Admin)
//! - **Multiple backends**: In-memory, SQLite, PostgreSQL (planned)
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use perfgate_server::{ServerConfig, StorageBackend, run_server};
//!
//! #[tokio::main]
//! async fn main() {
//! let config = ServerConfig::new()
//! .bind("0.0.0.0:8080").unwrap()
//! .storage_backend(StorageBackend::Sqlite)
//! .sqlite_path("perfgate.db");
//!
//! run_server(config).await.unwrap();
//! }
//! ```
//!
//! # API Endpoints
//!
//! | Method | Path | Description |
//! |--------|------|-------------|
//! | POST | `/projects/{project}/baselines` | Upload a baseline |
//! | GET | `/projects/{project}/baselines/{benchmark}/latest` | Get latest baseline |
//! | GET | `/projects/{project}/baselines/{benchmark}/versions/{version}` | Get specific version |
//! | GET | `/projects/{project}/baselines` | List baselines |
//! | DELETE | `/projects/{project}/baselines/{benchmark}/versions/{version}` | Delete baseline |
//! | POST | `/projects/{project}/baselines/{benchmark}/promote` | Promote version |
//! | GET | `/audit` | List audit events (admin only) |
//! | GET | `/health` | Health check |
//! | GET | `/metrics` | Prometheus metrics |
pub use ;
pub use ;
pub use *;
pub use ;
pub use ;
pub use ;
/// Server version string.
pub const VERSION: &str = env!;