mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
21 lines
434 B
Go
21 lines
434 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/teris-io/shortid"
|
|
)
|
|
|
|
// Event is any kind of event. A type is required to be specified.
|
|
type Event struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Type EventType `json:"type,omitempty"`
|
|
ID string `json:"id"`
|
|
}
|
|
|
|
// SetDefaults will set default properties of all inbound events.
|
|
func (e *Event) SetDefaults() {
|
|
e.ID = shortid.MustGenerate()
|
|
e.Timestamp = time.Now()
|
|
}
|