Skip to main content

harmos_domain/operations/host/
mod.rs

1/* ***
2 *
3 * Harmos
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * ***
8 */
9
10/* === Modules === */
11
12mod payloads;
13
14/* === Re-Exports === */
15
16pub use payloads::*;
17
18/* === Imports === */
19
20// Standard Library Imports
21use std::time::Duration;
22// Third Party Imports
23
24// Local Imports
25use crate::operations::{Contract, OperationPolicy, RestartPolicy, RetryPolicy, Visibility};
26use crate::plugin::Grant;
27
28/* === Constants === */
29
30pub const POLICY: OperationPolicy = OperationPolicy {
31    timeout: Duration::from_secs(30),
32    attempt_timeout: Duration::from_secs(30),
33    retries: RetryPolicy::Never,
34    restart: RestartPolicy::Never,
35};
36
37/* === Macros === */
38
39crate::declare!(Catalog {
40    id: "host.catalog",
41    version: 1,
42    policy: POLICY,
43    response: CatalogPage,
44    description: "Page live operation contracts or the schemas, streams and objects storage holds durably",
45    visibility: Visibility::Shared,
46    grpc: ("harmos.host.v1", "Host", "Catalog"),
47    grant: Catalog::required_grant,
48});
49
50/* === Type Aliases === */
51
52/* === Structs === */
53
54// A Live Provider Contract. Invocation Still Performs Request-Specific Authorization.
55#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
56pub struct DiscoveredOperation {
57    pub owner: crate::Identifier,
58    pub generation: u64,
59    pub contract: Contract,
60    pub grants: Vec<Grant>,
61    pub conditional_access: bool,
62    pub grpc_available: bool,
63}
64
65/* === Enums === */
66
67/* === Traits === */
68
69/* === Implementations === */
70
71/* === Public Functions === */
72
73/* === Private Functions === */
74
75/* === Tests === */