mirror of
https://github.com/cubixle/l1.git
synced 2026-04-30 10:48:41 +01:00
init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user