| 61 | } |
| 62 | |
| 63 | type Attacker interface { |
| 64 | // Attack keeps the request running for the specified period of time. |
| 65 | // Results are sent to the given channel as soon as they arrive. |
| 66 | // When the attack is over, it gives back final statistics. |
| 67 | // TODO: Use storage instead of metricsCh |
| 68 | Attack(ctx context.Context, metricsCh chan *Metrics) error |
| 69 | |
| 70 | // Rate gives back the rate set to itself. |
| 71 | Rate() int |
| 72 | // Rate gives back the duration set to itself. |
| 73 | Duration() time.Duration |
| 74 | // Rate gives back the method set to itself. |
| 75 | Method() string |
| 76 | } |
| 77 | |
| 78 | func NewAttacker(storage storage.Writer, target string, opts *Options) (Attacker, error) { |
| 79 | if target == "" { |
no outgoing calls
no test coverage detected