File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
internal/mithril-aggregator-discovery/src Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 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 } ;
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments