Documentation
¶
Index ¶
- func DeleteOldEvents(olderThan time.Duration) (int64, error)
- func GetEvent(eventID string) (*models.Event, error)
- func GetEvents(filters EventFilters) ([]models.Event, int, error)
- func GetEventsByEntity(entityType, entityID string, limit int) ([]models.Event, error)
- func GetRecentEventsBySeverity(severity string, limit int) ([]models.Event, error)
- type EventFilters
- type EventStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteOldEvents ¶
DeleteOldEvents deletes events older than the specified duration This can be used for data retention policies
func GetEvents ¶
func GetEvents(filters EventFilters) ([]models.Event, int, error)
GetEvents retrieves events from PostgreSQL with filters
func GetEventsByEntity ¶
GetEventsByEntity retrieves all events for a specific entity
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
Click to show internal directories.
Click to hide internal directories.