This commit is contained in:
Kujtim Hoxha
2025-03-21 18:20:28 +01:00
commit 4b0ea68d7a
28 changed files with 2229 additions and 0 deletions

22
internal/pubsub/events.go Normal file
View File

@@ -0,0 +1,22 @@
package pubsub
const (
CreatedEvent EventType = "created"
UpdatedEvent EventType = "updated"
DeletedEvent EventType = "deleted"
)
type (
// EventType identifies the type of event
EventType string
// Event represents an event in the lifecycle of a resource
Event[T any] struct {
Type EventType
Payload T
}
Publisher[T any] interface {
Publish(EventType, T)
}
)