summaryrefslogtreecommitdiffhomepage
path: root/internal/pubsub
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-03-23 19:19:08 +0100
committerKujtim Hoxha <[email protected]>2025-03-23 19:19:08 +0100
commit8daa6e774a6e02698c90392e7b2008542f789594 (patch)
tree8053fc1a4de87fc8dc3fd6e776577b0221c02ac5 /internal/pubsub
parent796bbf4d66c0fc70e750c7f582019cb9a7298e59 (diff)
downloadopencode-8daa6e774a6e02698c90392e7b2008542f789594.tar.gz
opencode-8daa6e774a6e02698c90392e7b2008542f789594.zip
add initial stuff
Diffstat (limited to 'internal/pubsub')
-rw-r--r--internal/pubsub/events.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/pubsub/events.go b/internal/pubsub/events.go
index c560f6925..2fb0a7413 100644
--- a/internal/pubsub/events.go
+++ b/internal/pubsub/events.go
@@ -1,11 +1,17 @@
package pubsub
+import "context"
+
const (
CreatedEvent EventType = "created"
UpdatedEvent EventType = "updated"
DeletedEvent EventType = "deleted"
)
+type Suscriber[T any] interface {
+ Subscribe(context.Context) <-chan Event[T]
+}
+
type (
// EventType identifies the type of event
EventType string