Remove embedded WriteEvent from WrittenEvent struct, to avoid having unnecessary fields. (#101081)

This commit is contained in:
Peter Štibraný
2025-02-20 17:34:25 +01:00
committed by GitHub
parent 6e5de80ef2
commit b4c4b9abbd
4 changed files with 27 additions and 16 deletions
+10 -4
View File
@@ -21,18 +21,24 @@ type WriteEvent struct {
ObjectOld utils.GrafanaMetaAccessor
}
// WriteEvents after they include a resource version
// WrittenEvent is a WriteEvent reported with a resource version.
type WrittenEvent struct {
WriteEvent
Type WatchEvent_Type
Key *ResourceKey
PreviousRV int64
// The json payload (without resourceVersion)
Value []byte
// Metadata
Folder string
// The resource version
// The resource version.
ResourceVersion int64
// Timestamp when the event is created
Timestamp int64
}
// A function to write events
// EventAppender is a function to write events.
type EventAppender = func(context.Context, *WriteEvent) (int64, error)