34 lines
626 B
Go
34 lines
626 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Event struct {
|
|
Updated uint64
|
|
ID string
|
|
URL string
|
|
TS uint64
|
|
Name string
|
|
Asset string
|
|
Datacenter string
|
|
Team string
|
|
Resolved bool
|
|
}
|
|
|
|
func NewEvent(ID, URL string, TS uint64, Name, Asset, Datacenter, Team string, Resolved bool) Event {
|
|
return Event{
|
|
Updated: updated(),
|
|
ID: ID,
|
|
URL: URL,
|
|
TS: TS,
|
|
Name: Name,
|
|
Asset: Asset,
|
|
Datacenter: Datacenter,
|
|
Team: Team,
|
|
Resolved: Resolved,
|
|
}
|
|
}
|
|
|
|
func updated() uint64 {
|
|
return uint64(time.Now().UnixNano() / int64(time.Millisecond))
|
|
}
|