2016-08-26 20:32:04 +00:00
|
|
|
package data
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/satori/go.uuid"
|
|
|
|
"reflect"
|
2016-08-27 05:10:15 +00:00
|
|
|
"time"
|
2016-08-26 20:32:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Event struct {
|
2016-08-27 05:10:15 +00:00
|
|
|
AggregateId uuid.UUID
|
|
|
|
CreationTime time.Time
|
|
|
|
Payload interface{}
|
|
|
|
Metadata interface{}
|
2016-08-26 20:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (me *Event) Equals(other *Event) bool {
|
|
|
|
return me.AggregateId == other.AggregateId && reflect.DeepEqual(me.Payload, other.Payload)
|
|
|
|
}
|