sos_protocol/
constants.rs

1//! Constants for the networking protocols.
2
3/// Constants for MIME types.
4mod mime {
5    /// Mime type for protocol buffers.
6    pub const MIME_TYPE_PROTOBUF: &str = "application/x-protobuf";
7
8    /// Mime type for JSON.
9    pub const MIME_TYPE_JSON: &str = "application/json";
10}
11
12/// Constants for header names or values.
13mod header {
14    /// Header name used to specify an account address.
15    pub const X_SOS_ACCOUNT_ID: &str = "x-sos-account-id";
16
17    /// Header name used to specify a request id.
18    pub const X_SOS_REQUEST_ID: &str = "x-sos-request-id";
19}
20
21/// Route paths.
22pub mod routes {
23    /// Routes for v1.
24    pub mod v1 {
25
26        /// List accounts; local IPC server only.
27        pub const ACCOUNTS_LIST: &str = "/api/v1/accounts";
28
29        /// Route for syncing account data.
30        pub const SYNC_ACCOUNT: &str = "/api/v1/sync/account";
31
32        /// Route for sync account status.
33        pub const SYNC_ACCOUNT_STATUS: &str = "/api/v1/sync/account/status";
34
35        /// Route for syncing account events.
36        pub const SYNC_ACCOUNT_EVENTS: &str = "/api/v1/sync/account/events";
37    }
38}
39
40pub use header::*;
41pub use mime::*;