MCPcopy
hub / github.com/nakabonne/ali / Attacker

Interface Attacker

attacker/attacker.go:63–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63type 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
78func NewAttacker(storage storage.Writer, target string, opts *Options) (Attacker, error) {
79 if target == "" {

Callers 10

TestAttackFunction · 0.95
AttackMethod · 0.65
attackFunction · 0.65
runFunction · 0.65
TestNewResolverFunction · 0.65
NewResolverFunction · 0.65
runFunction · 0.65
attackFunction · 0.65
runFunction · 0.65

Implementers 3

exportingAttackerexport_pending_test.go
attackerattacker/attacker.go
FakeAttackerattacker/fake_attacker.go

Calls

no outgoing calls

Tested by

no test coverage detected