mirror of
https://github.com/cubixle/l1.git
synced 2026-04-30 03:48:45 +01:00
adds comments and removes unused options
This commit is contained in:
@@ -1,46 +1,47 @@
|
||||
package l1
|
||||
|
||||
import "time"
|
||||
|
||||
// Opt
|
||||
type Opt func(*Runner)
|
||||
|
||||
// WithMaxConns will set the maximum amount of connections
|
||||
// you want the runners to make.
|
||||
//
|
||||
// If this is not passed to the NewRunner() the default will be
|
||||
// set to 10.
|
||||
func WithMaxConns(amount int) Opt {
|
||||
return func(r *Runner) {
|
||||
r.MaxConnections = amount
|
||||
}
|
||||
}
|
||||
|
||||
func WithTimeout(timeInSecs int) Opt {
|
||||
return func(r *Runner) {
|
||||
r.Timeout = time.Duration(timeInSecs) * time.Second
|
||||
}
|
||||
}
|
||||
|
||||
func WithRunTime(timeInSecs int) Opt {
|
||||
return func(r *Runner) {
|
||||
r.RunTime = time.Duration(timeInSecs) * time.Second
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxParrellConns will set the max parrell connections
|
||||
// you want the runners to use.
|
||||
//
|
||||
// If this is not passed to the NewRunner() the default will be
|
||||
// set to 10.
|
||||
func WithMaxParrellConns(amount int) Opt {
|
||||
return func(r *Runner) {
|
||||
r.MaxParrellConnections = amount
|
||||
}
|
||||
}
|
||||
|
||||
// WithTarget sets the target, the target will be passed to the runner
|
||||
// function.
|
||||
func WithTarget(target string) Opt {
|
||||
return func(r *Runner) {
|
||||
r.Target = target
|
||||
}
|
||||
}
|
||||
|
||||
// WithRunFunc will set the function used by the requests pool.
|
||||
func WithRunFunc(f F) Opt {
|
||||
return func(r *Runner) {
|
||||
r.RunFunc = f
|
||||
}
|
||||
}
|
||||
|
||||
// WithRampUp will set the amount of time between each ramp up
|
||||
// stage.
|
||||
func WithRampUp(seconds int) Opt {
|
||||
return func(r *Runner) {
|
||||
r.RampUp = seconds
|
||||
|
||||
Reference in New Issue
Block a user