events

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOldEvents

func DeleteOldEvents(olderThan time.Duration) (int64, error)

DeleteOldEvents deletes events older than the specified duration This can be used for data retention policies

func GetEvent

func GetEvent(eventID string) (*models.Event, error)

GetEvent retrieves a single event by event_id

func GetEvents

func GetEvents(filters EventFilters) ([]models.Event, int, error)

GetEvents retrieves events from PostgreSQL with filters

func GetEventsByEntity

func GetEventsByEntity(entityType, entityID string, limit int) ([]models.Event, error)

GetEventsByEntity retrieves all events for a specific entity

func GetRecentEventsBySeverity

func GetRecentEventsBySeverity(severity string, limit int) ([]models.Event, error)

GetRecentEventsBySeverity retrieves recent events filtered by severity

Types

type EventFilters

type EventFilters struct {
	Limit      int
	Offset     int
	Service    string
	Severity   string
	EventType  string
	StartTime  *time.Time
	EndTime    *time.Time
	EntityType string
	EntityID   string
}

EventFilters represents filters for querying events

type EventStats

type EventStats struct {
	TotalEvents  int            `json:"total_events"`
	BySeverity   map[string]int `json:"by_severity"`
	ByService    map[string]int `json:"by_service"`
	ByType       map[string]int `json:"by_type"`
	RecentEvents []models.Event `json:"recent_events"`
}

EventStats represents aggregated event statistics

func GetEventStatistics

func GetEventStatistics() (*EventStats, error)

GetEventStatistics returns aggregated event statistics

Jump to

Keyboard shortcuts

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