aboutsummaryrefslogtreecommitdiff
path: root/src/Limiter/RateLimit.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Limiter/RateLimit.h')
-rw-r--r--src/Limiter/RateLimit.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Limiter/RateLimit.h b/src/Limiter/RateLimit.h
new file mode 100644
index 0000000..fabd05d
--- /dev/null
+++ b/src/Limiter/RateLimit.h
@@ -0,0 +1,20 @@
+#ifndef RATE_LIMIT_H
+#define RATE_LIMIT_H
+
+#include <stddef.h>
+
+typedef struct {
+ int max_requests;
+ int interval_seconds;
+} RateLimitConfig;
+
+typedef struct {
+ int limited;
+ int retry_after_seconds;
+} RateLimitResult;
+
+void rate_limit_get_client_key(char *client_key, size_t client_key_size);
+RateLimitResult rate_limit_check(const char *scope,
+ const RateLimitConfig *config);
+
+#endif