mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:17:32 +00:00
feat: pub sub (#1341)
* fix: pub sub * fix: adaot config to commands (and queries) * remove dependency on vv2 in v1 * fix: pub sub in new eventstore * fix tests Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ type BaseEvent struct {
|
||||
User string `json:"-"`
|
||||
//Service is the service which created the event
|
||||
Service string `json:"-"`
|
||||
Data []byte `json:"-"`
|
||||
}
|
||||
|
||||
// EditorService implements EventPusher
|
||||
@@ -54,6 +55,11 @@ func (e *BaseEvent) Aggregate() Aggregate {
|
||||
return e.aggregate
|
||||
}
|
||||
|
||||
//Data returns the payload of the event. It represent the changed fields by the event
|
||||
func (e *BaseEvent) DataAsBytes() []byte {
|
||||
return e.Data
|
||||
}
|
||||
|
||||
//BaseEventFromRepo maps a stored event to a BaseEvent
|
||||
func BaseEventFromRepo(event *repository.Event) *BaseEvent {
|
||||
return &BaseEvent{
|
||||
@@ -68,6 +74,7 @@ func BaseEventFromRepo(event *repository.Event) *BaseEvent {
|
||||
sequence: event.Sequence,
|
||||
Service: event.EditorService,
|
||||
User: event.EditorUser,
|
||||
Data: event.Data,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user