MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / SetEnforcer

Method SetEnforcer

internal/agent/api.go:463–463  ·  view source on GitHub ↗

SetEnforcer wires in the resource-limits enforcer. When nil (the default) every check passes — handlers behave as if every user has unlimited capacity. The cmd/e2a runtime always sets it; tests that don't care about limits omit it and continue to work as before.

(e limits.Enforcer)

Source from the content-addressed store, hash-verified

461// unlimited capacity. The cmd/e2a runtime always sets it; tests that
462// don't care about limits omit it and continue to work as before.
463func (a *API) SetEnforcer(e limits.Enforcer) { a.enforcer = e }
464
465// SendLimitAllow exposes the per-agent outbound rate limiter so the v1 httpapi
466// layer shares the *same* token bucket as the legacy handlers (a caller hitting

Callers 7

TestServerFunction · 0.95
NewEventsAPIHarnessFunction · 0.95
StartContractServerFunction · 0.95
newConsentFixtureFunction · 0.95
setupAPIWithLimitsFunction · 0.95
mainFunction · 0.95

Calls

no outgoing calls

Tested by 4

TestServerFunction · 0.76
newConsentFixtureFunction · 0.76
setupAPIWithLimitsFunction · 0.76