esdiag 0.16.4

Elastic Stack diagnostic collector and processor
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License 2.0;
// you may not use this file except in compliance with the Elastic License 2.0.

/// Shared client libraries for remote connections
pub mod client;
/// Data structures and types for serializing and deserializing
pub mod data;
/// Embedded assets
pub mod embeds;
/// Environment variables
pub mod env;
/// Exports data to various destinations
pub mod exporter;
/// Shared job runner for saved diagnostic jobs
#[cfg(feature = "keystore")]
pub mod job;
/// Data transformation and processing logic
pub mod processor;
/// Receive data from various sources
pub mod receiver;
/// Serve the ESDiag http API
#[cfg(feature = "server")]
pub mod server;
/// Send pre-built assets (index templates, etc) to Elasticsearch
#[cfg(feature = "setup")]
pub mod setup;
/// Upload raw diagnostic archives to Elastic Upload Service
pub mod uploader;

#[cfg(test)]
pub(crate) fn test_env_lock() -> &'static std::sync::Mutex<()> {
    use std::sync::{Mutex, OnceLock};

    static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
    LOCK.get_or_init(|| Mutex::new(()))
}