[package]
name = "cachey"
version = "0.10.12"
edition = "2024"
authors = ["s2 team <hi@s2.dev>"]
license = "MIT"
repository = "https://github.com/s2-streamstore/cachey"
description = "Read-through cache for object storage"

[dependencies]
async-stream = "0.3"
aws-config = "1.8"
aws-sdk-s3 = { version = "1", default-features = false, features = [
    "behavior-version-latest",
    "rt-tokio",
    "default-https-client",
] }
aws-smithy-runtime-api = "1.12"
axum = { version = "0.8", features = ["macros"] }
axum-server = { version = "0.8", features = ["tls-rustls"] }
bytes = "1.12"
bytesize = "2.4"
clap = { version = "4.6", features = ["derive"] }
compact_str = { version = "0.9", features = ["serde"] }
crossbeam = "0.8"
dashmap = "6.2"
exponential-decay-histogram = "0.1"
eyre = "0.6"
foyer = "0.22"
futures = "0.3"
http = "1.4"
http-body = "1.0"
http-body-util = "0.1"
http-content-range = "0.2"
http-range-header = "0.4.2"
httpdate = "1.0"
itertools = "0.15"
jemalloc_pprof = { version = "0.8", optional = true, features = ["flamegraph"] }
mixtrics = { version = "0.2", features = ["prometheus_0_14"] }
parking_lot = "0.12"
prometheus = { version = "0.14", features = ["process"] }
rcgen = { version = "0.14", default-features = false, features = ["aws_lc_rs", "pem"] }
serde = "1.0"
thiserror = "2.0"
tikv-jemallocator = { version = "0.6", optional = true, features = ["profiling", "unprefixed_malloc_on_supported_platforms"] }
tikv-jemalloc-ctl = { version = "0.6", optional = true, features = ["stats"] }
tokio = { version = "1", features = ["full", "test-util"] }
tracing = "0.1"
tracing-subscriber = "0.3"

[features]
jemalloc = ["dep:tikv-jemallocator", "dep:jemalloc_pprof", "dep:tikv-jemalloc-ctl"]

[dev-dependencies]
hyper = "1"
hyper-util = { version = "0.1", features = ["client", "client-legacy", "http2", "tokio"] }
proptest = "1.11"
reqwest = { version = "0.13", features = ["json"] }
serde_json = "1.0"
testcontainers = { version = "0.27", default-features = false, features = ["aws-lc-rs", "http_wait"] }

[lints.clippy]
pedantic = { level = "warn", priority = -1 }

cast_possible_truncation = "allow"
cast_precision_loss = "allow"
cast_sign_loss = "allow"
cast_possible_wrap = "allow"
missing_errors_doc = "allow"
similar_names = "allow"
unnecessary_wraps = "allow"

[lints.rust]
unsafe_code = "warn"

[profile.release]
debug = 1
strip = false
