Files
doctate/doctate-common/src/constants.rs
T
Brummel ed5047a3ff Add doctate-common crate for shared types
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.
2026-04-17 15:17:37 +02:00

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";