This PR adds a goframe framework adapter for Sentinel. With this adapter, developers can easily integrate Sentinel's rate limiting and circuit breaker functionalities into their goframe projects, thereby enhancing system stability and reliability.
- Implemented the
SentinelMiddleware
function to integrate Sentinel into the goframe framework. - Added the
withResourceExtractor
option to allow developers to customize resource extraction logic. - Added the
WithBlockFallback
option to allow developers to customize fallback logic when blocked. - Wrote corresponding test cases to ensure the correctness and stability of the adapter.
- go test -run ^TestSentinelMiddlewareDefault -v
- go test -run ^TestSentineIMiddlewareExtractor -v
- go test -run ^TestSentinelMiddlewareFallback -v