This commit is contained in:
cubixle
2021-07-25 20:52:56 +01:00
parent 645ff9d698
commit 2ddeeea267
7 changed files with 140 additions and 10 deletions
+20 -2
View File
@@ -11,9 +11,9 @@ func WithMaxConns(amount int) Opt {
}
}
func WithTimeout(s int) Opt {
func WithTimeout(timeInSecs int) Opt {
return func(r *Runner) {
r.Timeout = s
r.Timeout = time.Duration(timeInSecs) * time.Second
}
}
@@ -22,3 +22,21 @@ func WithRunTime(timeInSecs int) Opt {
r.RunTime = time.Duration(timeInSecs) * time.Second
}
}
func WithMaxParrellConns(amount int) Opt {
return func(r *Runner) {
r.MaxParrellConnections = amount
}
}
func WithTarget(target string) Opt {
return func(r *Runner) {
r.Target = target
}
}
func WithRunFunc(f F) Opt {
return func(r *Runner) {
r.RunFunc = f
}
}