Rust

The Adapter trait every orchestrator implements, and the Settings they share.

Contents

use utopia_orchestration::Settings;
Rust
pub struct Settings

What every container gets from its orchestrator: the namespace of the labels it is given, and its CPU, memory and swap limits.

Also implements Default.
use utopia_orchestration::Adapter;
Rust
pub trait Adapter: Send + Sync

Runs containers and networks on a container engine. Implement it to add an engine; DockerCli and DockerApi are Docker's.

The futures borrow their arguments, so the trait is object safe.

Implemented byBoxDockerApiDockerCli
use utopia_orchestration::filter_env_key;
Rust
pub fn filter_env_key(key: &str) -> String

An environment variable name as Docker is given it: every byte but A-Za-z0-9_.- dropped.

Rust
use utopia_orchestration::filter_env_key;

assert_eq!(filter_env_key("APP ENV!"), "APPENV");
assert_eq!(filter_env_key("_APP_REDIS.HOST-1"), "_APP_REDIS.HOST-1");