Commit Graph

28 Commits

Author SHA1 Message Date
bitfl0wer 5bbf1cef1f Add prefix "Default" To Gateway, -Handler and HeartbeatHandler 2023-11-15 20:58:10 +01:00
bitfl0wer e4cc201b79 Remove all imports of Gateway and GatewayHandle 2023-11-15 20:57:06 +01:00
bitfl0wer aa657d12fc Ensure rt and rt_multi_thread aren't both enabled 2023-11-13 15:26:46 +01:00
bitfl0wer fe8baeb699 Make UrlBundle `Hash` 2023-08-30 19:13:46 +02:00
bitfl0wer a8bea5d881 Clippy rules, docs logo 2023-08-28 12:27:38 +02:00
bitfl0wer 2f9936cfd2 Add rustdoc comments 2023-08-26 19:41:00 +02:00
kozabrada123 ede965411e Minor doc changes 2023-07-29 11:26:00 +02:00
kozabrada123 83d4ffc4e8 Moar docs 2023-07-29 10:23:04 +02:00
kozabrada123 322894e4e9 UrlBundle slightly better docs 2023-07-10 17:22:31 +02:00
Flori 69b7c2445c Ratelimiter overhaul (#144)
* Rename limits and limit to have better names

* Remove empty lines

* Remove handle_request (moved to requestlimiter)

* Start working on new ratelimiter

* Make limits Option, add "limited?" to constructor

* Add missing logic to send_request

* Rename Limits

* Create Ratelimits and Limit Struct

* Define Limit

* Import Ratelimits

* Define get_rate_limits

* Remove unused import

* + check_rate_limits & limits_config_to_ratelimits

* Remove Absolute Limits
These limits are not meant to be tracked anyways.

* add ratelimits is_exhausted

* Add error handling and send request checking

* change limits to option ratelimits

* Add strum

* Change Ratelimits to Hashmap

* Remove ratelimits in favor of hashmap

* Change code from struct to hashmap

* start working on update rate limits

* Remove wrong import

* Rename ChorusLibError to ChorusError

* Documented the chorus errors

* Made error documentation docstring

* Make ReceivedErrorCodeError have error string

* Remove unneeded import

* Match changes in errors.rs

* Improve update_rate_limits and can_send_request

* add ratelimits.to_hash_map()

* use instances' client instead of new client

* add LimitsConfiguration to instance

* improve update_limits, change a method name

* Fix un-updated errors

* Get LimitConfiguration in a sane way

* Move common.rs into ratelimiter::ChorusRequest

* Delete common.rs

* Make instance.rs use overhauled errors

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* Refactor to use new Rate limiting implementation

* update ratelimiter implementation across all files

* Fix remaining errors post-refactor

* Changed Enum case to be correct

* Use result

* Re-add missing body to request

* Remove unneeded late initalization

* Change visibility from pub to pub(crate)
I feel like these core methods don't need to be exposed as public API.

* Remove unnecessary import

* Fix clippy warnings

* Add docstring

* Change Error names across all files

* Update Cargo.toml

Strum is not needed

* Update ratelimits.rs

* Update ratelimits.rs

* Bug/discord instance info unavailable (#146)

* Change text to be more ambigous

* Use default Configuration instead of erroring out

* Emit warning log if instance config cant be gotten

* Remove import

* Update src/instance.rs

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>

* Add missing closing bracket

* Put limits and limits_configuration as one struct

* Derive Hash

* remove import

* rename limits and limits_configuration

* Save clone call

* Change LimitsConfiguration to RateLimits
`LimitsConfiguration` is in no way related to whether the instance has API rate limits enabled or not. Therefore, it has been replaced with what it should have been all along.

* Add ensure_limit_in_map(), add `window` to `Limit`

* Remove unneeded var

* Remove import

* Clean up unneeded things
Dead code warnings have been supressed, but flagged as FIXME so they don't get forgotten. Anyone using tools like TODO Tree in VSCode can still see that they are there, however, they will not be shown as warnings anymore

* Remove nested submodule `limit`

* Add doc comments

* Add more doc comments

* Add some log messages to some methods

---------

Co-authored-by: SpecificProtagonist <specificprotagonist@posteo.org>
2023-07-09 18:38:02 +02:00
Vincent Junge 9c7031abde UrlBundle remove getters 2023-06-20 12:29:52 +02:00
Vincent Junge 208eeac536 Fix various Clippy lints 2023-06-19 12:35:07 +02:00
Flori Weber f641dbb14f Reformat entire project, optimize imports 2023-06-11 13:52:31 +02:00
Quaternion bb8f34b751 Un-lock mod errors 2023-05-26 10:23:11 -04:00
Quaternion 1bc7eb6a6e Lock client specific code behind feature 2023-05-26 10:16:08 -04:00
bitfl0wer 48113825b8 Integrate polyphony-types into chorus 2023-05-25 21:11:08 +02:00
bitfl0wer aaf454ffa7 remove println 2023-05-09 17:19:04 +02:00
bitfl0wer b199d11889 Made modules public, removed 110 warnings 2023-05-09 14:04:46 +02:00
bitfl0wer 3b8891b2dd Improve readability 2023-04-25 17:41:14 +02:00
bitfl0wer 06bc2955a3 Move custom errros to central file 2023-04-21 16:18:20 +02:00
bitfl0wer 4c9ddc4569 Add PartialEq and Eq derives 2023-04-16 22:16:39 +02:00
bitfl0wer 57a1df35e6 Fix incorrect url formatting, add more tests 2023-04-15 13:27:34 +02:00
bitfl0wer 13a2b2daab Fixed goofy ahh way to remove a slash from the end of the url 2023-04-15 13:03:51 +02:00
bitfl0wer 69247a9468 add: impl display for limit, check_limits 2023-04-10 17:20:02 +02:00
bitfl0wer 8bee42aeaa Remove http 2023-04-10 14:18:33 +02:00
bitfl0wer 17a618e8f0 Indicate that code block is of type Rust 2023-04-05 22:19:15 +02:00
bitfl0wer 9609480fd7 Add url parser and tests 2023-04-05 21:54:27 +02:00
bitfl0wer 6f84797e98 main -> lib 2023-04-04 17:37:11 +02:00