mirror of
https://github.com/MontFerret/ferret.git
synced 2025-06-23 00:28:10 +02:00
Refactored dynamic elements
This commit is contained in:
37
pkg/stdlib/html/driver/static/options.go
Normal file
37
pkg/stdlib/html/driver/static/options.go
Normal file
@ -0,0 +1,37 @@
|
||||
package static
|
||||
|
||||
import "github.com/sethgrid/pester"
|
||||
|
||||
type (
|
||||
Option func(opts *pester.Client)
|
||||
)
|
||||
|
||||
func WithDefaultBackoff() Option {
|
||||
return func(opts *pester.Client) {
|
||||
opts.Backoff = pester.DefaultBackoff
|
||||
}
|
||||
}
|
||||
|
||||
func WithLinearBackoff() Option {
|
||||
return func(opts *pester.Client) {
|
||||
opts.Backoff = pester.LinearBackoff
|
||||
}
|
||||
}
|
||||
|
||||
func WithExponentialBackoff() Option {
|
||||
return func(opts *pester.Client) {
|
||||
opts.Backoff = pester.ExponentialBackoff
|
||||
}
|
||||
}
|
||||
|
||||
func WithMaxRetries(value int) Option {
|
||||
return func(opts *pester.Client) {
|
||||
opts.MaxRetries = value
|
||||
}
|
||||
}
|
||||
|
||||
func WithConcurrency(value int) Option {
|
||||
return func(opts *pester.Client) {
|
||||
opts.Concurrency = value
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user