timber_rust/service/loki/data.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 Dante Doménech Martinez dante19031999@gmail.com
3
4#![cfg(feature = "loki")]
5#![cfg_attr(docsrs, doc(cfg(feature = "loki")))]
6
7use reqwest::blocking::Client;
8use crate::service::loki::config::Config;
9
10/// Shared state and configuration for the Loki service.
11///
12/// This struct is typically wrapped in an [`Arc`][`std::sync::Arc`] to be shared between the
13/// frontend logger and the background worker thread.
14pub struct Data {
15 /// The pre-configured HTTP client (handles connection pooling).
16 pub client: Client,
17 /// User-defined configuration (retries, timeouts, labels).
18 pub config: Config,
19 /// The full computed URL (e.g., `http://host:port/loki/api/v1/push`).
20 pub post_url: String,
21}