[package]
name = "hyperi-rustlib"
version = "1.16.1"
edition = "2024"
rust-version = "1.94"
description = "Shared utility library for HyperI Rust applications"
license = "FSL-1.1-ALv2"
repository = "https://github.com/hyperi-io/hyperi-rustlib"
publish = true
keywords = ["hyperi", "config", "logging", "metrics", "opentelemetry"]
categories = ["development-tools"]
exclude = [".claude/", ".github/", "ci/", "ai/", "docs/", "examples/", "benches/", "scripts/"]
[features]
default = ["config", "logger", "metrics", "env", "runtime"]
env = []
runtime = ["dirs"]
config = ["figment", "dotenvy", "serde_yaml_ng", "serde_json", "toml", "dirs", "tracing"]
logger = ["tracing", "tracing-subscriber", "owo-colors", "serde_json"]
metrics = ["dep:metrics", "metrics-exporter-prometheus", "sysinfo", "tokio"]
otel = ["opentelemetry", "opentelemetry_sdk", "opentelemetry-otlp", "tracing-opentelemetry", "tracing"]
otel-metrics = ["otel", "dep:metrics", "metrics-util", "metrics-exporter-opentelemetry", "sysinfo", "tokio", "tracing"]
otel-tracing = ["otel"]
directory-config = ["serde_yaml_ng", "tokio", "tracing", "fs4"]
directory-config-git = ["directory-config", "git2"]
http = ["reqwest", "reqwest-middleware", "reqwest-retry"]
http-server = ["axum", "tower", "tower-http", "tokio"]
spool = ["yaque", "zstd"]
tiered-sink = ["yaque", "zstd", "lz4_flex", "snap", "tokio", "tower-resilience"]
resilience = ["tower-resilience", "tower"]
database = []
cache = []
scaling = ["parking_lot", "tracing"]
cli = ["clap", "tracing"]
top = ["cli", "ratatui"]
io = ["file-rotate", "parking_lot", "chrono", "tracing"]
dlq = ["io", "base64", "serde_json", "tokio", "async-trait", "tracing"]
dlq-kafka = ["dlq", "transport-kafka"]
output-file = ["io", "serde_json", "tracing"]
expression = ["cel-interpreter", "serde_json"]
deployment = ["serde_yaml_ng", "serde_json"]
version-check = ["reqwest", "tokio", "serde_json", "tracing", "uuid", "chrono"]
config-reload = ["config", "parking_lot", "tokio", "tracing"]
config-postgres = ["config", "sqlx", "tokio", "serde_json"]
transport = ["tokio", "serde_json", "rmp-serde", "chrono", "async-trait"]
transport-memory = ["transport"]
transport-kafka = ["transport", "rdkafka"]
transport-grpc = ["transport", "dep:tonic", "dep:tonic-prost", "dep:prost", "dep:prost-types", "dep:tonic-prost-build", "dep:prost-build"]
transport-grpc-vector-compat = ["transport-grpc"]
transport-all = ["transport-memory", "transport-kafka", "transport-grpc"]
secrets = ["tokio", "serde_json", "async-trait", "parking_lot", "base64", "dirs", "tracing"]
secrets-vault = ["secrets", "vaultrs"]
secrets-aws = ["secrets", "aws-config", "aws-sdk-secretsmanager"]
secrets-all = ["secrets-vault", "secrets-aws"]
full = ["config", "config-reload", "logger", "metrics", "otel", "otel-metrics", "env", "runtime", "http", "http-server", "spool", "tiered-sink", "resilience", "database", "cache", "transport-all", "transport-grpc-vector-compat", "secrets-all", "directory-config", "directory-config-git", "deployment", "version-check", "scaling", "cli", "io", "dlq", "dlq-kafka", "output-file", "expression"]
[dependencies]
serde = { version = ">=1.0.228, <2", features = ["derive"] }
thiserror = ">=2.0.18, <3"
dirs = { version = ">=6.0.0, <7", optional = true }
figment = { version = ">=0.10.19, <0.11", features = ["yaml", "toml", "json", "env"], optional = true }
dotenvy = { version = ">=0.15.7, <0.16", optional = true }
serde_yaml_ng = { version = ">=0.10.0, <0.11", optional = true }
serde_json = { version = ">=1.0.149, <2", optional = true }
toml = { version = ">=0.8, <2", optional = true }
uuid = { version = ">=1.10, <2", features = ["v4"], optional = true }
fs4 = { version = ">=0.12, <0.14", features = ["sync"], optional = true }
git2 = { version = ">=0.20.0, <0.21", optional = true }
cel-interpreter = { version = ">=0.10.0, <0.11", features = ["json"], optional = true }
clap = { version = ">=4.5, <5", features = ["derive", "env"], optional = true }
tracing = { version = ">=0.1.44, <0.2", optional = true }
tracing-subscriber = { version = ">=0.3.22, <0.4", features = ["json", "env-filter", "fmt", "time", "local-time"], optional = true }
time = { version = ">=0.3.45, <0.4", optional = true }
owo-colors = { version = ">=4.2.3, <5", optional = true }
opentelemetry = { version = ">=0.31.0, <0.32", optional = true }
opentelemetry_sdk = { version = ">=0.31.0, <0.32", features = ["rt-tokio"], optional = true }
opentelemetry-otlp = { version = ">=0.31.0, <0.32", features = ["grpc-tonic", "http-proto", "metrics", "logs"], optional = true }
tracing-opentelemetry = { version = ">=0.32.1, <0.33", optional = true }
metrics = { version = ">=0.24.3, <0.25", optional = true }
metrics-exporter-prometheus = { version = ">=0.16, <0.19", optional = true }
metrics-util = { version = ">=0.20.1, <0.21", optional = true }
metrics-exporter-opentelemetry = { version = ">=0.2.1, <0.3", optional = true }
sysinfo = { version = ">=0.38.0, <0.39", optional = true }
tokio = { version = ">=1.50.0, <2", features = ["rt-multi-thread", "net", "sync", "time", "macros", "signal", "fs"], optional = true }
reqwest = { version = ">=0.12, <0.14", features = ["json", "blocking"], optional = true }
reqwest-middleware = { version = ">=0.5, <0.6", optional = true }
reqwest-retry = { version = ">=0.7, <0.10", optional = true }
axum = { version = ">=0.8.8, <0.9", optional = true }
tower = { version = ">=0.5.3, <0.6", optional = true }
tower-http = { version = ">=0.6.8, <0.7", features = ["timeout", "trace"], optional = true }
tower-resilience = { version = ">=0.4.0, <0.10", optional = true }
chrono = { version = ">=0.4.43, <0.5", optional = true }
rmp-serde = { version = ">=1.3.1, <2", optional = true }
rdkafka = { version = ">=0.39.0, <0.40", features = ["dynamic-linking"], optional = true }
tonic = { version = ">=0.14, <0.15", features = ["gzip"], optional = true }
tonic-prost = { version = ">=0.14.5, <0.15", optional = true }
prost = { version = ">=0.14, <0.15", optional = true }
prost-types = { version = ">=0.14, <0.15", optional = true }
ratatui = { version = ">=0.29, <0.32", optional = true }
file-rotate = { version = ">=0.7, <0.9", optional = true }
yaque = { version = ">=0.6.6, <0.7", optional = true }
zstd = { version = ">=0.13.3, <0.14", optional = true }
lz4_flex = { version = ">=0.11, <0.13", optional = true }
snap = { version = ">=1.1.1, <2", optional = true }
async-trait = { version = ">=0.1.88, <0.2", optional = true }
sqlx = { version = ">=0.8, <0.9", features = ["runtime-tokio", "tls-rustls-ring-webpki", "postgres", "json"], optional = true }
parking_lot = { version = ">=0.12.3, <0.13", optional = true }
base64 = { version = ">=0.22, <0.23", optional = true }
vaultrs = { version = ">=0.7, <0.8", optional = true }
aws-config = { version = ">=1.8, <2", optional = true }
aws-sdk-secretsmanager = { version = ">=1.102, <2", optional = true }
[build-dependencies]
tonic-prost-build = { version = ">=0.14.5, <0.15", optional = true }
prost-build = { version = ">=0.14, <0.15", optional = true }
[dev-dependencies]
tokio = { version = ">=1.50.0, <2", features = ["full", "test-util"] }
tempfile = ">=3.24.0, <4"
criterion = { version = ">=0.5, <0.9", features = ["html_reports"] }
pretty_assertions = ">=1.4.1, <2"
temp-env = ">=0.3.6, <0.4"
async-trait = ">=0.1.88, <0.2"
git2 = ">=0.20.0, <0.21"
[lints.rust]
unsafe_code = "deny"
[lints.clippy]
pedantic = { level = "warn", priority = -1 }
doc_markdown = "allow"
unnecessary_debug_formatting = "allow"
await_holding_lock = "allow"
redundant_closure = "allow"
redundant_closure_for_method_calls = "allow"
needless_raw_string_hashes = "allow"
items_after_statements = "allow"
inefficient_to_string = "allow"
unwrap_used = "allow"
[[bench]]
name = "config_benchmark"
harness = false
[[bench]]
name = "logger_benchmark"
harness = false