Skip to content

Commit

Permalink
Update option.go
Browse files Browse the repository at this point in the history
  • Loading branch information
tangfc authored Dec 19, 2024
1 parent c91a893 commit 012895c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/adapters/goframe/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type (
}
)

// evaluateOptions 评估选项
func evaluateOptions(opts []Option) *options {
optCopy := &options{}
for _, opt := range opts {
Expand All @@ -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
Expand Down

0 comments on commit 012895c

Please sign in to comment.