aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/mod.rs
blob: 86f5bcacca16d084061a7837fd4f4ccfc6012a93 (plain) (blame)
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
pub mod api_server;
mod error;
mod macros;

pub mod api;
mod router_v0;
mod router_v1;
mod router_v2;

mod bucket;
mod cluster;
mod key;
mod special;

use std::sync::Arc;

use async_trait::async_trait;

use garage_model::garage::Garage;

pub enum Authorization {
	None,
	MetricsToken,
	AdminToken,
}

#[async_trait]
pub trait EndpointHandler {
	type Response;

	async fn handle(self, garage: &Arc<Garage>) -> Result<Self::Response, error::Error>;
}