Commit Graph

52 Commits

Author SHA1 Message Date
Flori Weber f641dbb14f Reformat entire project, optimize imports 2023-06-11 13:52:31 +02:00
bitfl0wer b0a19faa48 Change InstanceServerError to ChorusLibError
The name InstanceServerError was chosen without thinking about it too much, very early in development. The new name suits this custom Error type way better, in my opinion.
2023-06-08 22:16:23 +02:00
bitfl0wer d797a10009 Add RateLimit information 2023-05-14 13:12:02 +02:00
bitfl0wer 598ad093a1 Improve error handling on request sending 2023-05-14 13:07:46 +02:00
bitfl0wer 5031db6547 Update docs, remove panic in favor of Err Result 2023-05-13 22:10:46 +02:00
bitfl0wer c436fdb857 Remove panic on send_request error 2023-05-13 22:06:44 +02:00
bitfl0wer 32f337015a cargo fix 2023-05-12 12:35:06 +02:00
bitfl0wer aaf454ffa7 remove println 2023-05-09 17:19:04 +02:00
bitfl0wer efb68a607a cargo clippy --fix 2023-05-03 16:38:42 +02:00
bitfl0wer 3b8891b2dd Improve readability 2023-04-25 17:41:14 +02:00
bitfl0wer a5943197d4 separate User and Instance limits. 2023-04-24 20:58:45 +02:00
bitfl0wer 30742380b9 Change HashMap<> to Limits 2023-04-24 19:49:26 +02:00
bitfl0wer 48333cf854 Make send_request return Result 2023-04-23 13:58:17 +02:00
bitfl0wer 7aedc371cf Have AuthRegister and AbsoluteRegister cancel each other out 2023-04-20 20:11:12 +02:00
bitfl0wer d2f3403a18 Improve limit check 2023-04-20 19:47:08 +02:00
bitfl0wer 8ac0c2994f add test_send_request 2023-04-15 18:16:26 +02:00
bitfl0wer 6b98a2cc23 add limit updates for Error, Global, Ip
Despite Error, Global and Ip technically being handled seperately, we still need to update their "reset" and "limit" values to match what the API tells us.
2023-04-15 17:12:33 +02:00
bitfl0wer 2ec0d3b9c8 remove unneccessary variable 2023-04-15 17:09:42 +02:00
bitfl0wer 62358d05db update internal values through mut ref 2023-04-15 17:07:46 +02:00
bitfl0wer c01adc28fa add fallback if no rate limit header received 2023-04-15 14:55:50 +02:00
bitfl0wer b758246b12 add test which checks instance rate limits working 2023-04-15 13:54:33 +02:00
bitfl0wer 38bf6dd5d1 rename tests 2023-04-15 13:27:43 +02:00
bitfl0wer ead320f145 Derive Debug, start debugging 2023-04-14 23:38:36 +02:00
bitfl0wer 3e405169e3 add documentation 2023-04-14 23:01:48 +02:00
bitfl0wer a8536df67e make send_request return Option<Response> 2023-04-14 22:40:13 +02:00
bitfl0wer f8da39b3d2 add send_request method 2023-04-14 22:22:23 +02:00
bitfl0wer 91fd86d3fc add new struct, send_request and can_send_request 2023-04-14 18:29:20 +02:00
bitfl0wer 599407373e reduce code complexity& duplication, fix oversight 2023-04-14 17:11:13 +02:00
bitfl0wer 15d9c9af7e reduce code duplication 2023-04-14 17:09:50 +02:00
bitfl0wer d00296790f handle resetting rate limits 2023-04-14 16:56:54 +02:00
bitfl0wer 2b1528564d implement update limits 2023-04-12 22:59:08 +02:00
bitfl0wer 6ca3bcd12c make code compile 2023-04-12 18:34:20 +02:00
bitfl0wer 4b3cd3a5d3 add update_limits (TODO) and add_to_queue 2023-04-12 18:33:16 +02:00
bitfl0wer 39a2c5340a Optimize imports, allow dead code where needed 2023-04-12 17:10:12 +02:00
bitfl0wer 317c8e801e refactor limit.rs, moved some logic 2023-04-12 16:49:18 +02:00
bitfl0wer 2d42423a1f me when i write bad code 2023-04-12 15:49:12 +02:00
bitfl0wer 9795b8696c Add todo 2023-04-11 21:27:37 +02:00
bitfl0wer e8cad2a4ff fix can_send_request 2023-04-11 21:27:06 +02:00
bitfl0wer d71b9e13ab add TODO comment 2023-04-10 21:02:29 +02:00
bitfl0wer e633f0f3b3 add can_send_request, update_limits and send_requests 2023-04-10 20:58:07 +02:00
bitfl0wer 4060cbc29e Add docstring, rename var 2023-04-10 17:35:04 +02:00
bitfl0wer 0c82c07685 remove tests, reformat limit display, rename limit 2023-04-10 17:30:02 +02:00
bitfl0wer 69247a9468 add: impl display for limit, check_limits 2023-04-10 17:20:02 +02:00
bitfl0wer 4eeb9895bc create test to... test 2023-04-10 14:18:48 +02:00
bitfl0wer e422785583 clean match and replace it with .unwrap_or_else 2023-04-08 23:56:53 +02:00
bitfl0wer c2715d1fb6 get response body string out of result 2023-04-08 23:31:28 +02:00
bitfl0wer 3cdf24b284 add notes on what needs to be done. 2023-04-08 14:51:36 +02:00
bitfl0wer 8d30e1461b Use Vec<Limit> instead of Limit because there are multiple limits 2023-04-08 14:37:20 +02:00
bitfl0wer f237de7353 add bucket identifiers, add check_limits stub 2023-04-07 23:22:44 +02:00
bitfl0wer f87bb89612 replace Box<> with VecDeque<> 2023-04-07 21:51:50 +02:00