-
-
Save azhuox/4d870f46e9480c0737f36b4acc8cc631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package meetingevents | |
import "encoding/json" | |
type meetingEndedEvent struct { | |
MeetingID string `json:"meeting_id"` | |
HostID string `json:"host_id"` | |
Duration int `json:"duration"` | |
... | |
} | |
func (s *EventService) ProcessEvents(rawEvent *RawEvent) error { | |
switch rawEvent.Type { | |
case "meeting-ended": | |
event := meetingEndedEvent{} | |
_ = json.Unmarshal([]byte(rawEvent.String()), &event) | |
...go | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment