ed5047a3ff
This commit introduces a new `doctate-common` crate to the workspace. This crate will house shared data structures and constants used by both the `doctate-server` and any future clients. This refactoring helps to: - Reduce code duplication. - Improve maintainability by centralizing common logic. - Define a clear API contract for server-client communication. The following modules have been added: - `ack`: Contains `AckResponse` and `AckStatus` for server responses. - `constants`: Defines shared constants like API endpoints and multipart field names. - `timestamp`: Provides utilities for handling RFC3339 timestamps, including conversions to and from filesystem-safe strings.
15 lines
564 B
Rust
15 lines
564 B
Rust
/// HTTP header that carries the per-user API key on `/api/...` requests.
|
|
pub const API_KEY_HEADER: &str = "X-API-Key";
|
|
|
|
/// Server endpoint path for recording upload (relative to the server base URL).
|
|
pub const UPLOAD_PATH: &str = "/api/upload";
|
|
|
|
// -- Multipart field names for POST /api/upload --
|
|
|
|
pub const FIELD_CASE_ID: &str = "case_id";
|
|
pub const FIELD_RECORDED_AT: &str = "recorded_at";
|
|
pub const FIELD_AUDIO: &str = "audio";
|
|
|
|
/// Content-Type of the audio part in the upload multipart body (m4a/AAC).
|
|
pub const CONTENT_TYPE_AUDIO_MP4: &str = "audio/mp4";
|