Skip to content

Commit

Permalink
feat(hubble): make indexers a json value
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiserKarel authored and cor committed Sep 13, 2023
1 parent 8448295 commit cc6f554
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions hubble/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ pub struct Args {
pub secret: String,
/// Indexer configurations to start.
#[arg(short, long, env = "HUBBLE_INDEXERS")]
pub indexers: Vec<IndexerConfig>,
pub indexers: Indexers,
}

#[derive(Clone, Debug, serde::Deserialize)]
pub struct Indexers(Vec<IndexerConfig>);

impl IntoIterator for Indexers {
type Item = IndexerConfig;

type IntoIter = std::vec::IntoIter<IndexerConfig>;

fn into_iter(self) -> Self::IntoIter {
self.0.into_iter()
}
}

#[derive(Clone, Debug, serde::Deserialize)]
Expand All @@ -34,7 +47,7 @@ impl IndexerConfig {
}
}

impl FromStr for IndexerConfig {
impl FromStr for Indexers {
type Err = color_eyre::eyre::Error;

fn from_str(item: &str) -> Result<Self, <Self as FromStr>::Err> {
Expand Down

0 comments on commit cc6f554

Please sign in to comment.