Simplify harvester enumeration and dispatch
Having to explain all the places where a new harvester needs to be registered and what conventions to follow and coming to the conclusion that we need a section in the HOWTO on this, I thought about it again and tried to reign in the accidental complexity using a small macro to enumerate and dispatch all harvester based on their module names.
So to add a new harvester after this, it needs to become a new module foo_bar.rs
under src/harvester
which exports a pub async fn harvester(dir: &Dir, client: &Client, source: &Source) -> Result<(usize, usize, usize)>
as usual. The only addition to this is adding it to the list of harvester passed to the dispatch_harvester!
macro invocation and it can then immediately be used via type = "foo_bar"
in harvester.toml
.