chore: adds notification to types

This commit is contained in:
Amir Raminfar
2026-01-24 09:16:59 -08:00
parent efcadfb98a
commit 10e4dfd17f
2 changed files with 19 additions and 10 deletions
+8
View File
@@ -359,6 +359,14 @@ func (m *Manager) processLogEvent(logEvent *container.LogEvent) {
ID: fmt.Sprintf("%s-%d", c.ID, time.Now().UnixNano()),
Container: notificationContainer,
Log: notificationLog,
Subscription: types.SubscriptionConfig{
ID: sub.ID,
Name: sub.Name,
Enabled: sub.Enabled,
DispatcherID: sub.DispatcherID,
LogExpression: sub.LogExpression,
ContainerExpression: sub.ContainerExpression,
},
Timestamp: time.Now(),
}
+11 -10
View File
@@ -4,10 +4,11 @@ import "time"
// Notification represents a notification event that can be filtered and sent
type Notification struct {
ID string `json:"id"`
Container NotificationContainer `json:"container"`
Log NotificationLog `json:"log"`
Timestamp time.Time `json:"timestamp"`
ID string `json:"id"`
Container NotificationContainer `json:"container"`
Log NotificationLog `json:"log"`
Subscription SubscriptionConfig `json:"subscription"`
Timestamp time.Time `json:"timestamp"`
}
// NotificationContainer represents a simplified container structure for notifications
@@ -33,12 +34,12 @@ type NotificationLog struct {
// SubscriptionConfig represents a notification subscription configuration
type SubscriptionConfig struct {
ID int
Name string
Enabled bool
DispatcherID int
LogExpression string
ContainerExpression string
ID int `json:"id"`
Name string `json:"name"`
Enabled bool `json:"-"`
DispatcherID int `json:"-"`
LogExpression string `json:"logExpression"`
ContainerExpression string `json:"containerExpression"`
}
// DispatcherConfig represents a notification dispatcher configuration