[package]
name = "memberlist"
version = "0.5.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
readme.workspace = true
rust-version.workspace = true
keywords.workspace = true
categories.workspace = true
description = "A highly customable, adaptable, async runtime agnostic Gossip protocol which helps manage cluster membership and member failure detection."

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = ["tokio", "compression", "encryption", "dns", "tcp", "quic"]

tokio = ["agnostic/tokio"]
async-std = ["agnostic/async-std"]
smol = ["agnostic/smol"]

serde = [
  "memberlist-core/serde",
  "memberlist-net?/serde",
  "memberlist-quic?/serde",
]

metrics = [
  "memberlist-core/metrics",
  "memberlist-net?/metrics",
  "memberlist-quic?/metrics",
]

compression = ["memberlist-net?/compression", "memberlist-quic?/compression"]

encryption = ["memberlist-net?/encryption", "memberlist-quic?/encryption", "memberlist-core/encryption"]

quic = ["memberlist-quic", "agnostic/quinn"]
quinn = ["memberlist-quic/quinn", "quic"]
s2n = ["memberlist-quic/s2n", "quic"]

net = ["memberlist-net", "agnostic/net"]
tcp = ["net"]
tls = ["memberlist-net/tls", "tcp"]
native-tls = ["memberlist-net/native-tls", "tcp"]

# enable DNS node address resolver
dns = ["memberlist-net?/dns", "memberlist-quic?/dns", "agnostic/dns"]
dns-over-quic = [
  "memberlist-net?/dns-over-quic",
  "memberlist-quic?/dns-over-quic",
]
dns-over-h3 = ["memberlist-net?/dns-over-h3", "memberlist-quic?/dns-over-h3"]
dns-over-https-rustls = [
  "memberlist-net?/dns-over-https-rustls",
  "memberlist-quic?/dns-over-https-rustls",
]
dns-over-rustls = [
  "memberlist-net?/dns-over-rustls",
  "memberlist-quic?/dns-over-rustls",
]
dns-over-openssl = [
  "memberlist-net?/dns-over-openssl",
  "memberlist-quic?/dns-over-openssl",
]
dns-over-native-tls = [
  "memberlist-net?/dns-over-native-tls",
  "memberlist-quic?/dns-over-native-tls",
]
dns-webpki-roots = [
  "memberlist-net?/dns-webpki-roots",
  "memberlist-quic?/dns-webpki-roots",
]
dns-native-certs = [
  "memberlist-net?/dns-native-certs",
  "memberlist-quic?/dns-native-certs",
]
dnssec-openssl = [
  "memberlist-net?/dnssec-openssl",
  "memberlist-quic?/dnssec-openssl",
]
dnssec-ring = ["memberlist-net?/dnssec-ring", "memberlist-quic?/dnssec-ring"]
dnssec = ["memberlist-net?/dnssec", "memberlist-quic?/dnssec"]

test = ["memberlist-core/test", "memberlist-net?/test", "memberlist-quic?/test"]

[dependencies]
agnostic-lite.workspace = true
agnostic = { workspace = true, optional = true }
memberlist-core.workspace = true
memberlist-net = { workspace = true, optional = true, default-features = false }
memberlist-quic = { workspace = true, optional = true, default-features = false }
nodecraft.workspace = true
smol_str.workspace = true
tracing.workspace = true

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
paste.workspace = true

[[test]]
name = "memberlist"
path = "tests/main.rs"
required-features = ["test"]
