diff --git a/core/common/src/utils.rs b/core/common/src/utils.rs index 2c7fca8f..2cfdc445 100644 --- a/core/common/src/utils.rs +++ b/core/common/src/utils.rs @@ -13,16 +13,23 @@ use strum_macros::Display; use tokio::time::{sleep, Duration}; use tonic::{Request, Status}; +/// An identifier used when discovering a service through Chariott. #[derive(Debug, Deserialize)] pub struct ServiceIdentifier { + /// The namespace of the service. pub namespace: String, + /// The name of the service. pub name: String, + /// The version of the service. pub version: String, } +/// An enum representing where to discover a service's URI. #[derive(Display, Debug, Deserialize)] pub enum ServiceUriSource { + /// Use the local configuration settings to find the service's URI. Local { service_uri: String }, + /// Use Chariott to discover the service's URI. Chariott { chariott_uri: String, service_identifier: ServiceIdentifier }, } diff --git a/core/module/managed_subscribe/src/managed_subscribe_module.rs b/core/module/managed_subscribe/src/managed_subscribe_module.rs index 38f56cbd..f336ebdb 100644 --- a/core/module/managed_subscribe/src/managed_subscribe_module.rs +++ b/core/module/managed_subscribe/src/managed_subscribe_module.rs @@ -61,17 +61,25 @@ pub enum TopicAction { Delete, } +/// Settings retrieved from a configuration file. #[derive(Debug, Deserialize)] pub struct ConfigSettings { + /// Where to host the Managed Subscribe module. pub base_authority: String, + /// Where to retrieve the Managed Subscribe Service URI from. pub managed_subscribe_uri_source: ServiceUriSource, } +/// Struct that handles communication with the Managed Subscribe service. #[derive(Clone, Debug)] pub struct ManagedSubscribeModule { + /// The URI of the Managed Subscribe service. pub managed_subscribe_uri: String, + /// The URI of the Managed Subscribe module. pub service_uri: String, + /// The protocol used to communicate with the Managed Subscribe module. pub service_protocol: String, + /// Shared store for the Managed Subscribe module. pub store: Arc>, }