MCPcopy Index your code
hub / github.com/dnote/dnote / ApplyLimit

Function ApplyLimit

pkg/server/middleware/limit.go:142–150  ·  view source on GitHub ↗

ApplyLimit applies rate limit conditionally using the global limiter

(h http.HandlerFunc, rateLimit bool)

Source from the content-addressed store, hash-verified

140
141// ApplyLimit applies rate limit conditionally using the global limiter
142func ApplyLimit(h http.HandlerFunc, rateLimit bool) http.Handler {
143 ret := h
144
145 if rateLimit {
146 ret = defaultLimiter.Limit(ret)
147 }
148
149 return ret
150}

Callers 2

WebMwFunction · 0.85
APIMwFunction · 0.85

Calls 1

LimitMethod · 0.80

Tested by

no test coverage detected