feat: stack model processor

This commit is contained in:
2025-10-05 14:53:13 +01:00
parent 0d41a65435
commit 64abf79f9c
8 changed files with 170 additions and 22 deletions

View File

@@ -9,7 +9,7 @@ import (
const (
IMAGE_TYPE = "image"
LIST_TYPE = "list"
STACK_TYPE = "list"
)
type ImageNotification struct {
@@ -21,18 +21,18 @@ type ImageNotification struct {
Status string
}
type ListNotification struct {
type StackNotification struct {
Type string
ListID uuid.UUID
Name string
StackID uuid.UUID
Name string
Status string
}
type Notification struct {
image *ImageNotification
list *ListNotification
stack *StackNotification
}
func GetImageNotification(image ImageNotification) Notification {
@@ -41,9 +41,9 @@ func GetImageNotification(image ImageNotification) Notification {
}
}
func GetListNotification(list ListNotification) Notification {
func GetStackNotification(list StackNotification) Notification {
return Notification{
list: &list,
stack: &list,
}
}
@@ -52,8 +52,8 @@ func (n Notification) MarshalJSON() ([]byte, error) {
return json.Marshal(n.image)
}
if n.list != nil {
return json.Marshal(n.list)
if n.stack != nil {
return json.Marshal(n.stack)
}
return nil, fmt.Errorf("no image or list present")