grafana 0.1.3

Ergonomic Rust SDK for Grafana's HTTP API, with async and blocking clients.
Documentation
use crate::{
    Client, Result,
    types::{SearchParams, SearchResult},
};

#[derive(Clone)]
pub struct SearchService {
    client: Client,
}

impl SearchService {
    pub(crate) fn new(client: Client) -> Self {
        Self { client }
    }

    pub async fn search(&self, params: &SearchParams) -> Result<Vec<SearchResult>> {
        self.client.get_json(&["search"], Some(params)).await
    }
}