mirror of
https://github.com/amir20/dozzle.git
synced 2026-08-07 11:44:45 +00:00
chore: adds notification to types
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user