refactored and expanded postgres keypool

This commit is contained in:
TotallyNot 2023-01-22 19:29:11 +01:00
parent 0fd74e7006
commit 9ae436c694
5 changed files with 560 additions and 142 deletions

View file

@ -1,28 +1,29 @@
[package]
name = "torn-key-pool"
version = "0.4.2"
version = "0.5.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/TotallyNot/torn-api.rs.git"
homepage = "https://github.com/TotallyNot/torn-api.rs.git"
description = "A generalizes API key pool for torn-api"
description = "A generalised API key pool for torn-api"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = [ "postgres", "tokio-runtime" ]
postgres = [ "dep:sqlx", "dep:chrono", "dep:indoc" ]
postgres = [ "dep:sqlx", "dep:chrono", "dep:indoc", "dep:serde" ]
reqwest = [ "dep:reqwest", "torn-api/reqwest" ]
awc = [ "dep:awc", "torn-api/awc" ]
tokio-runtime = [ "dep:tokio", "dep:rand" ]
actix-runtime = [ "dep:actix-rt", "dep:rand" ]
[dependencies]
torn-api = { path = "../torn-api", default-features = false, version = "0.5" }
torn-api = { path = "../torn-api", default-features = false, version = "0.5.5" }
async-trait = "0.1"
thiserror = "1"
sqlx = { version = "0.6", features = [ "postgres", "chrono" ], optional = true }
sqlx = { version = "0.6", features = [ "postgres", "chrono", "json" ], optional = true }
serde = { version = "1.0", optional = true }
chrono = { version = "0.4", optional = true }
indoc = { version = "1", optional = true }
tokio = { version = "1", optional = true, default-features = false, features = ["time"] }
@ -37,7 +38,7 @@ awc = { version = "3", default-features = false, optional = true }
torn-api = { path = "../torn-api", features = [ "reqwest" ] }
sqlx = { version = "0.6", features = [ "runtime-tokio-rustls" ] }
dotenv = "0.15.0"
tokio = { version = "1.20.1", features = ["test-util", "rt", "macros"] }
tokio = { version = "1.24.2", features = ["test-util", "rt", "macros"] }
tokio-test = "0.4.2"
reqwest = { version = "0.11", default-features = true }
awc = { version = "3", features = [ "rustls" ] }