Files
smallwebwaf/internal/alerts/export_test.go
T
sneak 0835a35df5
check / check (push) Waiting to run
Give ban causes, limit kinds, alert events, actions and dispositions named types (closes #428)
Each fixed set of string constants becomes a named string type in the
package that owns it, and the fields and parameters that carry it use
the type: bans.Cause, ratelimit.LimitKind, alerts.Event,
alerts.DestinationName, rules.Action, requestlog.Action,
requestlog.Offence, requestlog.WAFLineKind and wafprotocol.Disposition.
Every value keeps its string, so the logs, state files, alerts and
metrics do not change.

The switches exhaustive now checks list their missing cases.

Model: opus-5-5
2026-11-19 21:45:08 +00:00

19 lines
431 B
Go

package alerts
import "net/http"
// QueueSize is the most alerts that wait to be sent to a destination.
const QueueSize = queueSize
// SetTransport has q's requests to the destination name go through
// transport instead of the network.
func (q *Queue) SetTransport(
name DestinationName, transport http.RoundTripper,
) {
for _, d := range q.destinations {
if d.name == name {
d.httpClient.Transport = transport
}
}
}