Skip to content

Commit f46ff06

Browse files
committed
feat(aggregator-discovery): add models for aggregator endpoint
1 parent 1e5e81a commit f46ff06

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
#![warn(missing_docs)]
22
//! This crate provides mechanisms to discover aggregators in a Mithril network.
3+
mod model;
4+
pub use model::{AggregatorEndpoint, MithrilNetwork};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use mithril_common::StdResult;
2+
3+
/// Representation of a Mithril network
4+
// TODO: to move to mithril common
5+
#[derive(Debug, Clone, PartialEq, Eq)]
6+
pub struct MithrilNetwork(String);
7+
8+
impl MithrilNetwork {
9+
/// Create a new MithrilNetwork instance
10+
pub fn new(name: String) -> Self {
11+
Self(name)
12+
}
13+
14+
/// Create a dummy MithrilNetwork instance for testing purposes
15+
pub fn dummy() -> Self {
16+
Self("dummy".to_string())
17+
}
18+
}
19+
20+
/// Representation of an aggregator endpoint
21+
#[derive(Debug, Clone, PartialEq, Eq)]
22+
pub struct AggregatorEndpoint {
23+
url: String,
24+
}
25+
26+
impl AggregatorEndpoint {
27+
/// Create a new AggregatorEndpoint instance
28+
pub fn new(url: String) -> Self {
29+
Self { url }
30+
}
31+
32+
/// Retrieve the capabilities of the aggregator
33+
pub fn capabilities(&self) -> StdResult<()> {
34+
todo!("Implement capabilities retrieval")
35+
}
36+
}

0 commit comments

Comments
 (0)