quelch 0.12.0

Ingest data from Jira, Confluence, and more directly into Azure AI Search
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::config::Config;
use crate::cosmos::CosmosBackend;

pub async fn build_cosmos_backend(config: &Config) -> anyhow::Result<Box<dyn CosmosBackend>> {
    let endpoint = config.azure.cosmos.endpoint.clone();
    let endpoint = if endpoint.starts_with("https://") {
        endpoint
    } else {
        format!("https://{endpoint}.documents.azure.com:443/")
    };

    let client = crate::cosmos::CosmosClient::new(&endpoint, &config.azure.cosmos.database).await?;
    Ok(Box::new(client))
}