Skip to content

Commit

Permalink
Added comments for structs and enum definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
devkelley committed Oct 13, 2023
1 parent eaefdf1 commit 67fcebb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/common/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
}

Expand Down
8 changes: 8 additions & 0 deletions core/module/managed_subscribe/src/managed_subscribe_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RwLock<ManagedSubscribeStore>>,
}

Expand Down

0 comments on commit 67fcebb

Please sign in to comment.