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

Function attack

gui/keybinds.go:48–66  ·  view source on GitHub ↗
(ctx context.Context, cancelParent context.CancelFunc, d *drawer, a attacker.Attacker)

Source from the content-addressed store, hash-verified

46}
47
48func attack(ctx context.Context, cancelParent context.CancelFunc, d *drawer, a attacker.Attacker) {
49 if d.chartDrawing.Load() {
50 return
51 }
52 child, cancelChild := context.WithCancel(ctx)
53
54 // To initialize, run redrawChart on a per-attack basis.
55 go d.redrawCharts(child)
56 go d.redrawGauge(child, a.Duration())
57 go func() {
58 if err := a.Attack(child, d.metricsCh); err != nil {
59 d.setExportErr(err)
60 cancelChild()
61 cancelParent()
62 return
63 }
64 cancelChild()
65 }()
66}

Callers 2

TestAttackFunction · 0.85
keybindsFunction · 0.85

Calls 5

redrawChartsMethod · 0.80
redrawGaugeMethod · 0.80
setExportErrMethod · 0.80
DurationMethod · 0.65
AttackMethod · 0.65

Tested by 1

TestAttackFunction · 0.68