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

feat(goframe): add sentinel adapter for goframe #587

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update option.go
tangfc authored Dec 19, 2024
commit 012895cfe249bf528c7571ce704734e4b3c2264b
5 changes: 2 additions & 3 deletions pkg/adapters/goframe/option.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ type (
}
)

// evaluateOptions 评估选项
func evaluateOptions(opts []Option) *options {
optCopy := &options{}
for _, opt := range opts {
@@ -20,14 +19,14 @@ func evaluateOptions(opts []Option) *options {
return optCopy
}

// WithResourceExtractor 设置资源提取器
// WithResourceExtractor sets the resource extractor of the web requests.
func WithResourceExtractor(fn func(*ghttp.Request) string) Option {
return func(opts *options) {
opts.resourceExtract = fn
}
}

// WithBlockFallback 设置被流控的回退处理函数
// WithBlockFallback sets the fallback handler when requests are blocked.
func WithBlockFallback(fn func(r *ghttp.Request)) Option {
return func(opts *options) {
opts.blockFallback = fn