From e4a2ae3541f6a107fac74bfe2fd2e28958d7c2d7 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 19 Jul 2023 16:43:41 +0300 Subject: [PATCH] Describe push subject --- CHANGELOG.md | 3 +++ events/inbox/push.go | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 events/inbox/push.go diff --git a/CHANGELOG.md b/CHANGELOG.md index cefd71a..56c86da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Describe push subject + ## [0.1.2] - 2023-07-18 ### Changed diff --git a/events/inbox/push.go b/events/inbox/push.go new file mode 100644 index 0000000..e219053 --- /dev/null +++ b/events/inbox/push.go @@ -0,0 +1,20 @@ +package inbox + +import ( + "github.com/google/uuid" + + "github.com/goverland-labs/platform-events/events" +) + +const ( + SubjectPushCreated = "inbox.push.created" +) + +type PushPayload struct { + Title string `json:"title"` + Body string `json:"body"` + ImageURL string `json:"image_url"` + UserID uuid.UUID `json:"user_id"` +} + +type PushHandler = events.Handler[PushPayload]