From 5b209cc654418d4f0beb0910794fb0ba310becb4 Mon Sep 17 00:00:00 2001 From: Romain Gallet Date: Mon, 7 Aug 2023 12:15:23 +0200 Subject: [PATCH] Shard pagination (#44) Shard pagination (#44) --- Cargo.lock | 633 ++++++++++++++--------------------------- Cargo.toml | 9 +- src/aws.rs | 24 +- src/cli_helpers.rs | 5 +- src/kinesis.rs | 78 ++--- src/kinesis/helpers.rs | 58 ++-- src/kinesis/models.rs | 7 +- src/kinesis/tests.rs | 121 ++++---- src/kinesis/ticker.rs | 22 +- src/main.rs | 21 +- src/sink.rs | 2 +- 11 files changed, 432 insertions(+), 548 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0a5cc55..e6bfaf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,16 +3,20 @@ version = 3 [[package]] -name = "ahash" -version = "0.7.6" +name = "addr2line" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "getrandom", - "once_cell", - "version_check", + "gimli", ] +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" version = "1.0.2" @@ -54,15 +58,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] @@ -73,7 +77,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -83,14 +87,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "arc-swap" @@ -100,24 +104,13 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "syn 2.0.27", ] [[package]] @@ -149,7 +142,7 @@ dependencies = [ "http", "hyper", "ring", - "time 0.3.22", + "time 0.3.23", "tokio", "tower", "tracing", @@ -308,7 +301,7 @@ dependencies = [ "percent-encoding", "regex", "sha2", - "time 0.3.22", + "time 0.3.23", "tracing", ] @@ -415,7 +408,7 @@ dependencies = [ "itoa", "num-integer", "ryu", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -444,10 +437,19 @@ dependencies = [ ] [[package]] -name = "base64" -version = "0.13.1" +name = "backtrace" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" @@ -471,6 +473,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + [[package]] name = "block-buffer" version = "0.10.4" @@ -531,9 +539,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.2" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", "clap_derive", @@ -542,13 +550,12 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.1" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", - "bitflags", "clap_lex", "once_cell", "strsim", @@ -556,14 +563,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -580,32 +587,13 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" -dependencies = [ - "atty", - "lazy_static", - "winapi", -] - -[[package]] -name = "config" -version = "0.13.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" dependencies = [ - "async-trait", - "json5", + "is-terminal", "lazy_static", - "nom", - "pathdiff", - "ron", - "rust-ini", - "serde", - "serde_json", - "toml", - "yaml-rust", + "windows-sys", ] [[package]] @@ -626,9 +614,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -682,17 +670,11 @@ dependencies = [ "subtle", ] -[[package]] -name = "dlv-list" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" - [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "env_logger" @@ -715,7 +697,7 @@ checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -812,11 +794,17 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -836,9 +824,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] [[package]] name = "heck" @@ -848,27 +833,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -927,9 +894,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1006,55 +973,32 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", + "hermit-abi", "rustix", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json5" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" -dependencies = [ - "pest", - "pest_derive", - "serde", -] - [[package]] name = "kinesis-tailr" version = "0.0.1" @@ -1066,7 +1010,6 @@ dependencies = [ "chrono", "clap", "colored", - "config", "ctrlc-async", "env_logger", "humantime", @@ -1086,9 +1029,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "linked-hash-map" @@ -1098,9 +1041,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" [[package]] name = "lock_api" @@ -1114,9 +1057,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" dependencies = [ "serde", ] @@ -1178,10 +1121,13 @@ dependencies = [ ] [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "miniz_oxide" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] [[package]] name = "mio" @@ -1191,7 +1137,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1200,7 +1146,7 @@ version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "cfg-if", "libc", @@ -1213,7 +1159,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", @@ -1221,16 +1167,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -1243,23 +1179,32 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.18.0" @@ -1281,16 +1226,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "ordered-multimap" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" -dependencies = [ - "dlv-list", - "hashbrown", -] - [[package]] name = "outref" version = "0.5.1" @@ -1320,87 +1255,37 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - [[package]] name = "percent-encoding" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" -[[package]] -name = "pest" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e68e84bfb01f0507134eac1e9b410a12ba379d064eab48c50ba4ce329a527b70" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b79d4c71c865a25a4322296122e3924d30bc8ee0834c8bfc8b95f7f054afbfb" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c435bf1076437b851ebc8edc3a18442796b30f1728ffea6262d59bbe28b077e" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.18", -] - -[[package]] -name = "pest_meta" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745a452f8eb71e39ffd8ee32b3c5f51d03845f99786fa9b68db6ff509c505411" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -1416,18 +1301,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -1468,7 +1353,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1477,14 +1362,26 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.8.4" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", @@ -1493,9 +1390,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "ring" @@ -1513,25 +1410,10 @@ dependencies = [ ] [[package]] -name = "ron" -version = "0.7.1" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" -dependencies = [ - "base64 0.13.1", - "bitflags", - "serde", -] - -[[package]] -name = "rust-ini" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" -dependencies = [ - "cfg-if", - "ordered-multimap", -] +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc_version" @@ -1544,16 +1426,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ - "bitflags", + "bitflags 2.3.3", "errno", - "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1570,9 +1451,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -1582,33 +1463,33 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -1622,11 +1503,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -1635,9 +1516,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -1645,15 +1526,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.164" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b" dependencies = [ "serde_derive", ] @@ -1670,20 +1551,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "b23f7ade6f110613c0d63858ddb8b94c1041f550eab58a16b371bdf2c9c80ab4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -1704,9 +1585,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", @@ -1724,9 +1605,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "socket2" @@ -1775,9 +1656,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -1795,22 +1676,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -1837,9 +1718,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "serde", "time-core", @@ -1854,20 +1735,21 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -1875,7 +1757,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1886,7 +1768,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -1925,15 +1807,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "tower" version = "0.4.13" @@ -1977,13 +1850,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", ] [[package]] @@ -2016,17 +1889,11 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unsafe-any-ors" @@ -2045,9 +1912,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "urlencoding" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "utf8parse" @@ -2069,11 +1936,10 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -2091,9 +1957,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2101,24 +1967,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2126,28 +1992,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -2203,21 +2069,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -2229,97 +2080,55 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" diff --git a/Cargo.toml b/Cargo.toml index 8270339..2a423f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,11 +13,10 @@ edition = "2021" anyhow = "1.0" async-trait = "0.1" aws-config = { version = "0.55" } -aws-sdk-kinesis = { version = "0.28" } -chrono = "0.4" +aws-sdk-kinesis = { version = "0.28" } +chrono = { version = "0.4", features = ["clock", "std"] } clap = { version = "4.3", features = ["derive"] } colored = "2.0" -config = "0.13" ctrlc-async = "3.2" env_logger = "0.10" humantime = "2.1" @@ -26,7 +25,7 @@ log4rs = "1.2" nix = "0.26" rand = "0.8" thiserror = "1.0" -tokio = { version = "1.28", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.29", features = ["rt-multi-thread", "macros"] } [features] -default = ["clap/cargo", "clap/derive", "config/json"] +default = ["clap/cargo", "clap/derive"] diff --git a/src/aws.rs b/src/aws.rs index 8f4f106..42b0ecc 100644 --- a/src/aws.rs +++ b/src/aws.rs @@ -19,7 +19,11 @@ pub mod client { #[async_trait] pub trait KinesisClient: Sync + Send + Clone { - async fn list_shards(&self, stream: &str) -> Result; + async fn list_shards( + &self, + stream: &str, + next_token: Option<&str>, + ) -> Result; async fn get_records(&self, shard_iterator: &str) -> Result; @@ -52,13 +56,17 @@ pub mod client { #[async_trait] impl KinesisClient for AwsKinesisClient { - async fn list_shards(&self, stream: &str) -> Result { - self.client - .list_shards() - .stream_name(stream) - .send() - .await - .map_err(|e| e.into()) + async fn list_shards( + &self, + stream: &str, + next_token: Option<&str>, + ) -> Result { + let builder = match next_token { + Some(token) => self.client.list_shards().next_token(token), + None => self.client.list_shards().stream_name(stream), + }; + + builder.send().await.map_err(|e| e.into()) } async fn get_records(&self, shard_iterator: &str) -> Result { diff --git a/src/cli_helpers.rs b/src/cli_helpers.rs index fd7e9a2..ff40639 100644 --- a/src/cli_helpers.rs +++ b/src/cli_helpers.rs @@ -4,6 +4,8 @@ use chrono::{DateTime, Utc}; use clap::Parser; use log::info; +pub const SEMAPHORE_DEFAULT_SIZE: usize = 50; + #[derive(Debug, Parser)] #[command( version = "{#RELEASE_VERSION} - Grum Ltd\nReport bugs to https://github.com/grumlimited/kinesis-tailr/issues" @@ -67,8 +69,7 @@ pub struct Opt { /// Concurrent number of shards to tail #[structopt(short, long)] - #[clap(default_value_t = 10)] - pub concurrent: usize, + pub concurrent: Option, /// Display additional information #[structopt(short, long)] diff --git a/src/kinesis.rs b/src/kinesis.rs index 276026c..7ff8618 100644 --- a/src/kinesis.rs +++ b/src/kinesis.rs @@ -1,19 +1,20 @@ -use crate::aws::client::KinesisClient; -use crate::kinesis::helpers::wait_secs; -use crate::kinesis::models::*; -use crate::kinesis::ticker::TickerUpdate; use anyhow::Result; use async_trait::async_trait; use aws_sdk_kinesis::operation::get_records::GetRecordsError; use aws_sdk_kinesis::operation::get_shard_iterator::GetShardIteratorOutput; use chrono::prelude::*; use chrono::{DateTime, Utc}; -use log::{debug, info}; +use log::debug; use tokio::sync::mpsc; use tokio::sync::mpsc::Sender; use tokio::time::{sleep, Duration}; use GetRecordsError::{ExpiredIteratorException, ProvisionedThroughputExceededException}; +use crate::aws::client::KinesisClient; +use crate::kinesis::helpers::wait_secs; +use crate::kinesis::models::*; +use crate::kinesis::ticker::{ShardCountUpdate, TickerMessage}; + pub mod helpers; pub mod models; pub mod ticker; @@ -47,7 +48,6 @@ where let result = self .publish_records_shard( &shard_iterator, - res.shard_id.clone(), self.get_config().tx_ticker_updates.clone(), tx_shard_iterator_progress.clone(), ) @@ -56,7 +56,11 @@ where if let Err(e) = result { match e.downcast_ref::() { Some(ExpiredIteratorException(inner)) => { - debug!("ExpiredIteratorException: {}", inner); + debug!( + "ExpiredIteratorException [{}]: {}", + self.get_config().shard_id, + inner + ); helpers::handle_iterator_refresh( res_clone.clone(), self.clone(), @@ -92,18 +96,31 @@ where } None => { self.get_config() - .tx_records - .send(Err(ProcessError::PanicError( - "ShardIterator is None".to_string(), - ))) + .tx_ticker_updates + .send(TickerMessage::RemoveShard(res.shard_id.clone())) .await - .expect(""); + .expect("Could not send RemoveShard to tx_ticker_updates"); + rx_shard_iterator_progress.close(); } }; drop(permit); } + debug!("ShardProcessor {} finished", self.get_config().shard_id); + + self.get_config() + .tx_ticker_updates + .send(TickerMessage::RemoveShard( + self.get_config().shard_id.clone(), + )) + .await?; + + self.get_config() + .tx_records + .send(Ok(ShardProcessorADT::BeyondToTimestamp)) + .await?; + Ok(()) } @@ -115,8 +132,6 @@ where debug!("Seeding shard {}", self.get_config().shard_id); - let tx_shard_iterator_progress = tx_shard_iterator_progress.clone(); - match self.get_iterator().await { Ok(resp) => { let shard_iterator: Option = resp.shard_iterator().map(|s| s.into()); @@ -142,16 +157,12 @@ where } /** - * Publish records from a shard iterator. - - * Because shards are multiplexed per ShardProcessor, we need to keep - * track of the shard_id for each shard_iterator. + * Publish records from a shard iterator. */ async fn publish_records_shard( &self, shard_iterator: &str, - shard_id: String, - tx_ticker_updates: Sender, + tx_ticker_updates: Sender, tx_shard_iterator_progress: Sender, ) -> Result<()> { let resp = self.get_config().client.get_records(shard_iterator).await?; @@ -167,7 +178,7 @@ where let datetime = *record.approximate_arrival_timestamp().unwrap(); RecordResult { - shard_id: shard_id.clone(), + shard_id: self.get_config().shard_id, sequence_id: record.sequence_number().unwrap().into(), partition_key: record.partition_key().unwrap_or("none").into(), datetime, @@ -182,10 +193,10 @@ where if let Some(millis_behind) = resp.millis_behind_latest() { tx_ticker_updates - .send(TickerUpdate { - shard_id: shard_id.clone(), + .send(TickerMessage::CountUpdate(ShardCountUpdate { + shard_id: self.get_config().shard_id.clone(), millis_behind, - }) + })) .await .expect("Could not send TickerUpdate to tx_ticker_updates"); } @@ -213,7 +224,7 @@ where .map(|s| s.into()); let shard_iterator_progress = ShardIteratorProgress { - shard_id: shard_id.clone(), + shard_id: self.get_config().shard_id, last_sequence_id, next_shard_iterator: next_shard_iterator.map(|s| s.into()), }; @@ -223,21 +234,24 @@ where .await .unwrap(); } else { - info!( + debug!( "{} records in batch for shard-id {} and {} records before {}", nb_records, - shard_id, + self.get_config().shard_id, nb_records_before_end_ts, self.get_config() .to_datetime .map(|ts| ts.to_rfc3339()) .unwrap_or("[No end timestamp]".to_string()) ); - self.get_config() - .tx_records - .send(Ok(ShardProcessorADT::BeyondToTimestamp)) - .await - .expect("Could not send BeyondToTimestamp to tx_records"); + + tx_shard_iterator_progress + .send(ShardIteratorProgress { + shard_id: self.get_config().shard_id.clone(), + last_sequence_id: None, + next_shard_iterator: None, + }) + .await?; } Ok(()) diff --git a/src/kinesis/helpers.rs b/src/kinesis/helpers.rs index 9dc2412..cf85eaa 100644 --- a/src/kinesis/helpers.rs +++ b/src/kinesis/helpers.rs @@ -8,9 +8,9 @@ use aws_sdk_kinesis::error::SdkError::ServiceError; use aws_sdk_kinesis::operation::get_shard_iterator::{ GetShardIteratorError, GetShardIteratorOutput, }; -use aws_sdk_kinesis::operation::list_shards::ListShardsError; +use aws_sdk_kinesis::operation::list_shards::{ListShardsError, ListShardsOutput}; use chrono::Utc; -use log::debug; +use log::{debug, info}; use tokio::sync::mpsc::Sender; use tokio::sync::Semaphore; use tokio::time::sleep; @@ -23,7 +23,7 @@ use crate::kinesis::models::{ ProcessError, ShardProcessor, ShardProcessorADT, ShardProcessorAtTimestamp, ShardProcessorConfig, ShardProcessorLatest, }; -use crate::kinesis::ticker::TickerUpdate; +use crate::kinesis::ticker::TickerMessage; use crate::kinesis::{IteratorProvider, ShardIteratorProgress}; #[allow(clippy::too_many_arguments)] @@ -35,7 +35,7 @@ pub fn new( to_datetime: Option>, semaphore: Arc, tx_records: Sender>, - tx_ticker_updates: Sender, + tx_ticker_updates: Sender, ) -> Box + Send + Sync> { debug!("Creating ShardProcessor with shard {}", shard_id); @@ -150,27 +150,47 @@ where } pub async fn get_shards(client: &AwsKinesisClient, stream: &str) -> io::Result> { - let resp = client - .list_shards(stream) - .await - .map_err(|e| { + let mut seed = client.list_shards(stream, None).await; + + let mut results: Vec = vec![]; + + while let Ok(result) = &seed { + results.push(result.clone()); + if let Some(next_token) = result.next_token() { + let result = client.list_shards(stream, Some(next_token)).await; + seed = result; + } else { + break; + } + } + + match seed { + Ok(_) => { + let shards: Vec = results + .iter() + .flat_map(|r| { + r.shards() + .unwrap() + .iter() + .map(|s| s.shard_id().unwrap().to_string()) + .collect::>() + }) + .collect::>(); + + info!("Found {} shards", shards.len()); + + Ok(shards) + } + Err(e) => { let message = match e.downcast_ref::>() { Some(ServiceError(inner)) => inner.err().to_string(), Some(other) => other.to_string(), _ => e.to_string(), }; - io::Error::new(io::ErrorKind::Other, message) - }) - .map(|e| { - e.shards() - .unwrap() - .iter() - .map(|s| s.shard_id.as_ref().unwrap().clone()) - .collect::>() - })?; - - Ok(resp) + Err(io::Error::new(io::ErrorKind::Other, message)) + } + } } pub fn wait_secs() -> u64 { diff --git a/src/kinesis/models.rs b/src/kinesis/models.rs index e152be0..5dfe6c7 100644 --- a/src/kinesis/models.rs +++ b/src/kinesis/models.rs @@ -1,7 +1,7 @@ use crate::aws::client::KinesisClient; use crate::iterator::ShardIterator; use crate::iterator::{at_timestamp, latest}; -use crate::kinesis::ticker::TickerUpdate; +use crate::kinesis::ticker::TickerMessage; use crate::kinesis::IteratorProvider; use anyhow::Result; use async_trait::async_trait; @@ -51,7 +51,7 @@ pub struct ShardProcessorConfig { pub to_datetime: Option>, pub semaphore: Arc, pub tx_records: Sender>, - pub tx_ticker_updates: Sender, + pub tx_ticker_updates: Sender, } #[derive(Clone)] @@ -101,8 +101,7 @@ pub trait ShardProcessor: Send + Sync { async fn publish_records_shard( &self, shard_iterator: &str, - shard_id: String, - tx_ticker: Sender, + tx_ticker: Sender, tx_shard_iterator_progress: Sender, ) -> Result<()>; diff --git a/src/kinesis/tests.rs b/src/kinesis/tests.rs index ef058f9..5491e03 100644 --- a/src/kinesis/tests.rs +++ b/src/kinesis/tests.rs @@ -1,11 +1,6 @@ -use crate::aws::client::KinesisClient; -use crate::kinesis::helpers; -use crate::kinesis::helpers::wait_secs; -use crate::kinesis::models::{ - ProcessError, RecordResult, ShardIteratorProgress, ShardProcessor, ShardProcessorADT, - ShardProcessorAtTimestamp, ShardProcessorConfig, ShardProcessorLatest, -}; -use crate::kinesis::ticker::TickerUpdate; +use std::ops::Add; +use std::sync::{Arc, Mutex}; + use anyhow::Result; use async_trait::async_trait; use aws_sdk_kinesis::config::Region; @@ -17,22 +12,28 @@ use aws_sdk_kinesis::types::error::InvalidArgumentException; use aws_sdk_kinesis::types::{Record, Shard}; use chrono::prelude::*; use chrono::Utc; -use std::ops::Add; -use std::sync::Arc; -use std::time::Duration; use tokio::sync::{mpsc, Semaphore}; -use tokio::time::sleep; + +use crate::aws::client::KinesisClient; +use crate::kinesis::helpers; +use crate::kinesis::helpers::wait_secs; +use crate::kinesis::models::{ + ProcessError, RecordResult, ShardIteratorProgress, ShardProcessor, ShardProcessorADT, + ShardProcessorAtTimestamp, ShardProcessorConfig, ShardProcessorLatest, +}; +use crate::kinesis::ticker::{ShardCountUpdate, TickerMessage}; #[tokio::test] async fn seed_shards_test() { let (tx_records, _) = mpsc::channel::>(10); - let (tx_ticker_updates, _) = mpsc::channel::(10); + let (tx_ticker_updates, _) = mpsc::channel::(10); let (tx_shard_iterator_progress, mut rx_shard_iterator_progress) = mpsc::channel::(1); let client = TestKinesisClient { region: Some(Region::new("us-east-1")), + done: Arc::new(Mutex::new(false)), }; let semaphore: Arc = Arc::new(Semaphore::new(10)); @@ -68,7 +69,7 @@ async fn seed_shards_test() { #[should_panic] async fn seed_shards_test_timestamp_in_future() { let (tx_records, _) = mpsc::channel::>(10); - let (tx_ticker_updates, _) = mpsc::channel::(10); + let (tx_ticker_updates, _) = mpsc::channel::(10); let (tx_shard_iterator_progress, _) = mpsc::channel::(1); @@ -98,17 +99,18 @@ async fn seed_shards_test_timestamp_in_future() { #[tokio::test] async fn produced_record_is_processed() { let (tx_records, mut rx_records) = mpsc::channel::>(10); - let (tx_ticker_updates, mut rx_ticker_updates) = mpsc::channel::(10); + let (tx_ticker_updates, mut rx_ticker_updates) = mpsc::channel::(10); let client = TestKinesisClient { region: Some(Region::new("us-east-1")), + done: Arc::new(Mutex::new(false)), }; let semaphore: Arc = Arc::new(Semaphore::new(10)); let processor = ShardProcessorLatest { config: ShardProcessorConfig { - client, + client: client.clone(), stream: "test".to_string(), shard_id: "shardId-000000000000".to_string(), to_datetime: None, @@ -121,45 +123,34 @@ async fn produced_record_is_processed() { // start producer tokio::spawn(async move { processor.run().await }); - let mut done_processing = false; - let mut closed_resources = false; - let mut count = 0; + let mut records_count = 0; let ticker_update = rx_ticker_updates.recv().await.unwrap(); assert_eq!( ticker_update, - TickerUpdate { + TickerMessage::CountUpdate(ShardCountUpdate { shard_id: "shardId-000000000000".to_string(), millis_behind: 1000 - } + }) ); while let Some(res) = rx_records.recv().await { - if !done_processing { - if let Ok(ShardProcessorADT::Progress(res)) = res { - count += res.len(); - } - - done_processing = true; - } else { - if !closed_resources { - sleep(Duration::from_millis(100)).await; - rx_records.close(); - } - closed_resources = true; + if let Ok(ShardProcessorADT::Progress(res)) = res { + records_count += res.len(); } } - assert_eq!(count, 1); + assert_eq!(records_count, 1); } #[tokio::test] async fn beyond_to_timestamp_is_received() { let (tx_records, mut rx_records) = mpsc::channel::>(10); - let (tx_ticker_updates, mut rx_ticker_updates) = mpsc::channel::(10); + let (tx_ticker_updates, mut rx_ticker_updates) = mpsc::channel::(10); let client = TestKinesisClient { region: Some(Region::new("us-east-1")), + done: Arc::new(Mutex::new(false)), }; let semaphore: Arc = Arc::new(Semaphore::new(10)); @@ -183,10 +174,10 @@ async fn beyond_to_timestamp_is_received() { let ticker_update = rx_ticker_updates.recv().await.unwrap(); assert_eq!( ticker_update, - TickerUpdate { + TickerMessage::CountUpdate(ShardCountUpdate { shard_id: "shardId-000000000000".to_string(), millis_behind: 1000 - } + }) ); let result = rx_records.recv().await.unwrap().unwrap(); @@ -196,10 +187,11 @@ async fn beyond_to_timestamp_is_received() { #[tokio::test] async fn has_records_beyond_end_ts_when_has_end_ts() { let (tx_records, _) = mpsc::channel::>(10); - let (tx_ticker_updates, _) = mpsc::channel::(10); + let (tx_ticker_updates, _) = mpsc::channel::(10); let client = TestKinesisClient { region: Some(Region::new("us-east-1")), + done: Arc::new(Mutex::new(false)), }; let semaphore: Arc = Arc::new(Semaphore::new(10)); @@ -257,10 +249,11 @@ async fn has_records_beyond_end_ts_when_has_end_ts() { #[tokio::test] async fn has_records_beyond_end_ts_when_no_end_ts() { let (tx_records, _) = mpsc::channel::>(10); - let (tx_ticker_updates, _) = mpsc::channel::(10); + let (tx_ticker_updates, _) = mpsc::channel::(10); let client = TestKinesisClient { region: Some(Region::new("us-east-1")), + done: Arc::new(Mutex::new(false)), }; let semaphore: Arc = Arc::new(Semaphore::new(10)); @@ -308,6 +301,7 @@ async fn handle_iterator_refresh_ok() { let client = TestKinesisClient { region: Some(Region::new("us-east-1")), + done: Arc::new(Mutex::new(false)), }; let provider = ShardProcessorLatest { @@ -318,7 +312,7 @@ async fn handle_iterator_refresh_ok() { to_datetime: None, semaphore: Arc::new(Semaphore::new(10)), tx_records: mpsc::channel::>(10).0, - tx_ticker_updates: mpsc::channel::(10).0, + tx_ticker_updates: mpsc::channel::(10).0, }, }; @@ -356,30 +350,43 @@ fn wait_secs_ok() { #[derive(Clone, Debug)] pub struct TestKinesisClient { region: Option, + done: Arc>, } #[async_trait] impl KinesisClient for TestKinesisClient { - async fn list_shards(&self, _stream: &str) -> Result { + async fn list_shards( + &self, + _stream: &str, + _next_token: Option<&str>, + ) -> Result { Ok(ListShardsOutput::builder() .shards(Shard::builder().shard_id("000001").build()) .build()) } async fn get_records(&self, _shard_iterator: &str) -> Result { - let to_datetime = Utc.with_ymd_and_hms(2021, 6, 1, 12, 0, 0).unwrap(); - let dt = DateTime::from_secs(to_datetime.timestamp()); - let record = Record::builder() - .approximate_arrival_timestamp(dt) - .sequence_number("1") - .data(Blob::new("data")) - .build(); - - Ok(GetRecordsOutput::builder() - .records(record) - .next_shard_iterator("shard_iterator2".to_string()) - .millis_behind_latest(1000) - .build()) + let mut current_done = self.done.lock().unwrap(); + + if *current_done { + Ok(GetRecordsOutput::builder().build()) + } else { + *current_done = true; + + let to_datetime = Utc.with_ymd_and_hms(2021, 6, 1, 12, 0, 0).unwrap(); + let dt = DateTime::from_secs(to_datetime.timestamp()); + let record = Record::builder() + .approximate_arrival_timestamp(dt) + .sequence_number("1") + .data(Blob::new("data")) + .build(); + + Ok(GetRecordsOutput::builder() + .records(record) + .next_shard_iterator("shard_iterator2".to_string()) + .millis_behind_latest(1000) + .build()) + } } async fn get_shard_iterator_at_timestamp( @@ -424,7 +431,11 @@ pub struct TestTimestampInFutureKinesisClient {} #[async_trait] impl KinesisClient for TestTimestampInFutureKinesisClient { - async fn list_shards(&self, _stream: &str) -> Result { + async fn list_shards( + &self, + _stream: &str, + _next_token: Option<&str>, + ) -> Result { unimplemented!() } diff --git a/src/kinesis/ticker.rs b/src/kinesis/ticker.rs index 915c914..64fa02a 100644 --- a/src/kinesis/ticker.rs +++ b/src/kinesis/ticker.rs @@ -9,18 +9,24 @@ use tokio::sync::Mutex; use tokio::time::{sleep, Duration}; #[derive(Debug, Clone, PartialEq)] -pub struct TickerUpdate { +pub enum TickerMessage { + CountUpdate(ShardCountUpdate), + RemoveShard(String), +} + +#[derive(Debug, Clone, PartialEq)] +pub struct ShardCountUpdate { pub shard_id: String, pub millis_behind: i64, } pub struct Ticker { counts: Arc>>, - rx_ticker_updates: Receiver, + rx_ticker_updates: Receiver, } impl Ticker { - pub fn new(rx_ticker_updates: Receiver) -> Self { + pub fn new(rx_ticker_updates: Receiver) -> Self { Self { counts: Arc::new(Mutex::new(HashMap::new())), rx_ticker_updates, @@ -37,8 +43,14 @@ impl Ticker { while let Some(res) = self.rx_ticker_updates.recv().await { let mut counts = counts.lock().await; let counts = counts.deref_mut(); - - counts.insert(res.shard_id.clone(), res.millis_behind); + match res { + TickerMessage::CountUpdate(res) => { + counts.insert(res.shard_id.clone(), res.millis_behind); + } + TickerMessage::RemoveShard(shard_id) => { + counts.remove(&shard_id); + } + } } } } diff --git a/src/main.rs b/src/main.rs index 2c4edad..8550867 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,13 @@ #![allow(clippy::result_large_err)] use anyhow::Result; -use kinesis::ticker::{Ticker, TickerUpdate}; +use kinesis::ticker::Ticker; use std::sync::Arc; use tokio::sync::{mpsc, Semaphore}; use crate::aws::client::*; use crate::cli_helpers::*; +use crate::kinesis::ticker::TickerMessage; use crate::sink::console::ConsoleSink; use crate::sink::file::FileSink; use crate::sink::Sink; @@ -36,13 +37,14 @@ async fn main() -> Result<()> { let client = create_client(opt.region.clone(), opt.endpoint_url.clone()).await; - let (tx_records, rx_records) = mpsc::channel::>(1000); - let shards = get_shards(&client, &opt.stream_name).await?; let selected_shards = selected_shards(shards, &opt.stream_name, &opt.shard_id)?; let shard_count = selected_shards.len(); + let (tx_records, rx_records) = + mpsc::channel::>(shard_count); + print_runtime(&opt, &selected_shards); let handle = tokio::spawn({ @@ -82,7 +84,7 @@ async fn main() -> Result<()> { } }); - let (tx_ticker_updates, rx_ticker_updates) = mpsc::channel::(shard_count); + let (tx_ticker_updates, rx_ticker_updates) = mpsc::channel::(shard_count); tokio::spawn({ let mut ticker = Ticker::new(rx_ticker_updates); @@ -93,7 +95,7 @@ async fn main() -> Result<()> { }); let shard_processors = { - let semaphore = Arc::new(Semaphore::new(opt.concurrent)); + let semaphore = semaphore(shard_count, opt.concurrent); selected_shards .iter() @@ -135,3 +137,12 @@ async fn main() -> Result<()> { Ok(()) } + +fn semaphore(shard_count: usize, concurrent: Option) -> Arc { + let concurrent = match concurrent { + Some(concurrent) => concurrent, + None => std::cmp::min(shard_count, SEMAPHORE_DEFAULT_SIZE), + }; + + Arc::new(Semaphore::new(concurrent)) +} diff --git a/src/sink.rs b/src/sink.rs index e02a58b..bdf97b9 100644 --- a/src/sink.rs +++ b/src/sink.rs @@ -128,7 +128,7 @@ where tx_records .send(Ok(ShardProcessorADT::Termination)) .await - .expect("Boom"); + .expect("Could not send termination message"); } } ShardProcessorADT::Progress(res) => match self.get_config().max_messages {