Files
l1/opts.go
cubixle 645ff9d698 init
2021-07-24 21:09:32 +01:00

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
}
}