add rate limiter

This commit is contained in:
ginuerzh committed 2022-09-05 22:47:51 +08:00
1 parent e23da0f319
commit 4c2131ca6d
40 files changed
+1622 -135

No files matched your search

+4 -4
View File
@@ -31,18 +31,18 @@ type rlimiterWrapper struct {
r *rlimiterRegistry
}
func (w *rlimiterWrapper) Input() limiter.Limiter {
func (w *rlimiterWrapper) In(key string) limiter.Limiter {
v := w.r.get(w.name)
if v == nil {
return nil
}
return v.Input()
return v.In(key)
}
func (w *rlimiterWrapper) Output() limiter.Limiter {
func (w *rlimiterWrapper) Out(key string) limiter.Limiter {
v := w.r.get(w.name)
if v == nil {
return nil
}
return v.Output()
return v.Out(key)
}