Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goframe framework adapter for sentinel #588

Merged
merged 1 commit into from
Dec 24, 2024
Merged

Conversation

tangfc
Copy link
Contributor

@tangfc tangfc commented Dec 24, 2024

Describe what this PR does / why we need it

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.

Does this pull request fix one issue?

NONE

Describe how you did it

  • 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.

Describe how to verify it

  • go test -run ^TestSentinelMiddlewareDefault -v
  • go test -run ^TestSentineIMiddlewareExtractor -v
  • go test -run ^TestSentinelMiddlewareFallback -v

Special notes for reviews

@LearningGp
Copy link
Collaborator

ref: #587

Copy link
Collaborator

@LearningGp LearningGp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LearningGp LearningGp merged commit f4c2c59 into alibaba:master Dec 24, 2024
4 checks passed
@LearningGp
Copy link
Collaborator

Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants