mirror of
https://github.com/cubixle/l1.git
synced 2026-04-24 21:14:45 +01:00
25 lines
356 B
Go
25 lines
356 B
Go
package l1
|
|
|
|
import "time"
|
|
|
|
// Opt
|
|
type Opt func(*Runner)
|
|
|
|
func WithMaxConns(amount int) Opt {
|
|
return func(r *Runner) {
|
|
r.MaxConnections = amount
|
|
}
|
|
}
|
|
|
|
func WithTimeout(s int) Opt {
|
|
return func(r *Runner) {
|
|
r.Timeout = s
|
|
}
|
|
}
|
|
|
|
func WithRunTime(timeInSecs int) Opt {
|
|
return func(r *Runner) {
|
|
r.RunTime = time.Duration(timeInSecs) * time.Second
|
|
}
|
|
}
|