Reexport crates for direct user access
flearc opened this issue · 2 comments
flearc commented
When using Consul as a datasource, users currently need to provide a Consul client and query options to instantiate ConsulDatasource. This involves importing the consul crate to create the client.
impl<P: SentinelRule + PartialEq + DeserializeOwned, H: PropertyHandler<P>> ConsulDataSource<P, H> {
pub fn new(
client: Client,
query_options: QueryOptions,
property: String,
handlers: Vec<Arc<H>>,
) -> Self {
let mut ds = DataSourceBase::default();
for h in handlers {
// incase of duplication, add it one by one, instead of adding all at once
ds.add_property_handler(h);
}
ConsulDataSource {
ds,
query_options,
property,
client,
closed: AtomicBool::new(false),
}
}
...
}
To streamline this process and mitigate potential version mismatches, consider reexporting the consul
crate. By doing so, users can avoid explicit crate imports, simplifying the setup and enhancing compatibility.
Additionally, other crates may also can be reexported:
apollo-client
etcd_rs
kube
prometheus_exporter
(user can register their custom metrics using this crate)
Forsworns commented
It's a good idea, and I guess these crates need upgradation, too.
flea1lt commented
Sorry for late reply, I will raise a PR when I have time.