collector

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventCollector

type EventCollector struct {
	// contains filtered or unexported fields
}

EventCollector aggregates and groups CloudTrail events for alerting

func NewEventCollector

func NewEventCollector(alertFunc func(*GroupedRecord, handler.Record)) *EventCollector

NewEventCollector creates a new EventCollector instance

func (*EventCollector) AddRecord

func (ec *EventCollector) AddRecord(record map[string]interface{}, userName, eventName, errorCode string, eventTime time.Time, eventRecord handler.Record)

AddRecord adds a CloudTrail record to the collector, grouping similar events

func (*EventCollector) SendAllAlerts

func (ec *EventCollector) SendAllAlerts()

SendAllAlerts sends alerts for all collected event groups

type GroupKey

type GroupKey struct {
	UserName  string
	EventName string
	ErrorCode string
}

GroupKey uniquely identifies a group of related CloudTrail events

type GroupedRecord

type GroupedRecord struct {
	Record         map[string]interface{}
	UserName       string
	EventName      string
	ErrorCode      string
	Count          int
	FirstEventTime time.Time
	LastEventTime  time.Time
}

GroupedRecord represents a collection of similar CloudTrail events

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL