Skip to content

Instantly share code, notes, and snippets.

@azhuox

azhuox/block8.go Secret

Created December 2, 2020 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azhuox/4d870f46e9480c0737f36b4acc8cc631 to your computer and use it in GitHub Desktop.
Save azhuox/4d870f46e9480c0737f36b4acc8cc631 to your computer and use it in GitHub Desktop.
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