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 #586

Closed
wants to merge 3 commits into from
Closed

Goframe #586

wants to merge 3 commits into from

Conversation

tangfc
Copy link
Contributor

@tangfc tangfc commented Dec 18, 2024

Describe what this PR does / why we need it

这个 PR 为 Sentinel 添加了 goframe 框架的适配器。通过这个适配器,开发者可以在 goframe 项目中方便地使用 Sentinel 的限流和熔断功能,提高系统的稳定性和可靠性。

Does this pull request fix one issue?

NONE

Describe how you did it

  1. 实现了 SentinelMiddleware 函数,用于在 goframe 框架中集成 Sentinel。
  2. 添加了 WithResourceExtractor 选项,允许开发者自定义资源提取逻辑。
  3. 添加了 WithBlockFallback 选项,允许开发者自定义阻塞时的回退逻辑。
  4. 编写了相应的测试用例,确保适配器的正确性和稳定性。

Describe how to verify it

  1. 运行测试用例:

    • go test -run ^TestSentinelMiddlewareDefault -v
    • go test -run ^TestSentinelMiddlewareExtractor -v
    • go test -run ^TestSentinelMiddlewareFallback -v
  2. 手动测试:

    • 启动一个 goframe 应用,集成 SentinelMiddleware
    • 发送请求并观察限流和熔断效果。
    • 测试 WithBlockFallback 选项的回退逻辑。

@CLAassistant
Copy link

CLAassistant commented Dec 18, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ tangfc
❌ tangfangchun


tangfangchun seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tangfc tangfc closed this by deleting the head repository Dec 18, 2024
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