2024-06-03 12:49:17: merge [main:72fad31e37b51d75b8c23bb36393fb2548694cec];
This commit is contained in:
1 parent
0a91198eb6
commit
bc88a51ec4
28 files changed
+1355
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"isp-lock-service/domain"
|
||||
)
|
||||
|
||||
type limiterService interface {
|
||||
Limit(ctx context.Context, req domain.RateLimiterRequest) (*domain.RateLimiterResponse, error)
|
||||
}
|
||||
|
||||
type RateLimiter struct {
|
||||
svc limiterService
|
||||
}
|
||||
|
||||
func NewRateLimiter(svc limiterService) RateLimiter {
|
||||
return RateLimiter{svc: svc}
|
||||
}
|
||||
|
||||
func (c RateLimiter) Limit(ctx context.Context, req domain.RateLimiterRequest) (*domain.RateLimiterResponse, error) {
|
||||
return c.svc.Limit(ctx, req)
|
||||
}
|
||||
Reference in new issue
Block a user