aboutsummaryrefslogtreecommitdiffstats
path: root/crates/server/src/handlers
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crates/server/src/handlers/mod.rs8
-rw-r--r--crates/server/src/handlers/v0/mod.rs2
-rw-r--r--crates/server/src/handlers/v0/record.rs8
3 files changed, 9 insertions, 9 deletions
diff --git a/crates/server/src/handlers/mod.rs b/crates/server/src/handlers/mod.rs
index e24bad14..1ac5a0c4 100644
--- a/crates/server/src/handlers/mod.rs
+++ b/crates/server/src/handlers/mod.rs
@@ -3,11 +3,11 @@ use axum::{Json, extract::State, http, response::IntoResponse};
use crate::router::AppState;
-pub mod v0;
+pub(crate) mod v0;
const VERSION: &str = env!("CARGO_PKG_VERSION");
-pub async fn index(state: State<AppState>) -> Json<IndexResponse> {
+pub(crate) async fn index(state: State<AppState>) -> Json<IndexResponse> {
let homage = r#""Through the fathomless deeps of space swims the star turtle Great A'Tuin, bearing on its back the four giant elephants who carry on their shoulders the mass of the Discworld." -- Sir Terry Pratchett"#;
let version = state
@@ -28,12 +28,12 @@ impl IntoResponse for ErrorResponseStatus<'_> {
}
}
-pub struct ErrorResponseStatus<'a> {
+pub(crate) struct ErrorResponseStatus<'a> {
pub error: ErrorResponse<'a>,
pub status: http::StatusCode,
}
-pub trait RespExt<'a> {
+pub(crate) trait RespExt<'a> {
fn with_status(self, status: http::StatusCode) -> ErrorResponseStatus<'a>;
fn reply(reason: &'a str) -> Self;
}
diff --git a/crates/server/src/handlers/v0/mod.rs b/crates/server/src/handlers/v0/mod.rs
index 2066636c..78fb47b8 100644
--- a/crates/server/src/handlers/v0/mod.rs
+++ b/crates/server/src/handlers/v0/mod.rs
@@ -1 +1 @@
-pub mod record;
+pub(crate) mod record;
diff --git a/crates/server/src/handlers/v0/record.rs b/crates/server/src/handlers/v0/record.rs
index f7758c1a..61fa2946 100644
--- a/crates/server/src/handlers/v0/record.rs
+++ b/crates/server/src/handlers/v0/record.rs
@@ -11,7 +11,7 @@ use crate::{
use turtle_common::record::{EncryptedData, HostId, Record, RecordIdx, RecordStatus};
#[instrument(skip_all, fields(user.id = user.id.to_string()))]
-pub async fn post(
+pub(crate) async fn post(
UserAuth(user): UserAuth,
state: State<AppState>,
Json(records): Json<Vec<Record<EncryptedData>>>,
@@ -50,7 +50,7 @@ pub async fn post(
}
#[instrument(skip_all, fields(user.id = user.id.to_string()))]
-pub async fn index(
+pub(crate) async fn index(
UserAuth(user): UserAuth,
state: State<AppState>,
) -> Result<Json<RecordStatus>, ErrorResponseStatus<'static>> {
@@ -75,7 +75,7 @@ pub async fn index(
}
#[derive(Deserialize)]
-pub struct NextParams {
+pub(crate) struct NextParams {
host: HostId,
tag: String,
start: Option<RecordIdx>,
@@ -83,7 +83,7 @@ pub struct NextParams {
}
#[instrument(skip_all, fields(user.id = user.id.to_string()))]
-pub async fn next(
+pub(crate) async fn next(
params: Query<NextParams>,
UserAuth(user): UserAuth,
state: State<AppState>,