Crate apollo_environment_detector

Source
Expand description

§Compute Environment Detector

This library provides two functions for easily detecting a ComputeEnvironment based on a given weighted threshold.

§Examples

use apollo_environment_detector::{detect, detect_one, MAX_INDIVIDUAL_WEIGHTING};

// Attempt to detect multiple environments based on a weighting.
let compute_envs = detect(MAX_INDIVIDUAL_WEIGHTING);
println!("{:?}", compute_envs);

// Attempt to detect a single environment based on a weighting.
let compute_env = detect_one(MAX_INDIVIDUAL_WEIGHTING);
println!("{:?}", compute_env);

Enums§

CloudProvider
Supported cloud providers that can be detected by this crate.
ComputeEnvironment
Supported compute environments that can be detected by this crate

Constants§

MAX_INDIVIDUAL_WEIGHTING
Represents the maximum individual detector weighting.
MAX_TOTAL_WEIGHTING
Represents the maximum weighting of all supported detectors (2^15).

Functions§

detect
Detect potential ComputeEnvironments above a certain weighted threshold.
detect_one
Detect a single, most likely ComputeEnvironment above a certain weighted threshold.