MCPcopy
hub / github.com/crowdsecurity/crowdsec / Add

Method Add

pkg/pipeline/queue.go:31–36  ·  view source on GitHub ↗

Add an event in the queue. If it has already l elements, the first element is dropped before adding the new m element

(m Event)

Source from the content-addressed store, hash-verified

29// Add an event in the queue. If it has already l elements, the first
30// element is dropped before adding the new m element
31func (q *Queue) Add(m Event) {
32 for len(q.Queue) > q.L { //we allow to add one element more than the true capacity
33 q.Queue = q.Queue[1:]
34 }
35 q.Queue = append(q.Queue, m)
36}
37
38// GetQueue returns the entire queue
39func (q *Queue) GetQueue() []Event {

Callers 15

CrowdsecCTIFunction · 0.45
TestCheckAllowlistFunction · 0.45
CreateOrUpdateAlertMethod · 0.45
createDecisionBatchMethod · 0.45
flushMetricsMethod · 0.45
flushBouncersMethod · 0.45
flushAgentsMethod · 0.45

Calls

no outgoing calls