8 "git.curoverse.com/arvados.git/sdk/go/arvados"
9 "github.com/ghodss/yaml"
12 type eventSink interface {
13 Channel() <-chan *event
17 type eventSource interface {
34 // Detail returns the database row corresponding to the event. It can
35 // be called safely from multiple goroutines. Only one attempt will be
36 // made. If the database row cannot be retrieved, Detail returns nil.
37 func (e *event) Detail() *arvados.Log {
40 if e.logRow != nil || e.err != nil {
43 var logRow arvados.Log
45 e.err = e.db.QueryRow(`SELECT id, uuid, object_uuid, COALESCE(object_owner_uuid,''), COALESCE(event_type,''), event_at, created_at, properties FROM logs WHERE id = $1`, e.LogID).Scan(
49 &logRow.ObjectOwnerUUID,
55 logger(nil).WithField("LogID", e.LogID).WithError(e.err).Error("QueryRow failed")
58 e.err = yaml.Unmarshal(propYAML, &logRow.Properties)
60 logger(nil).WithField("LogID", e.LogID).WithError(e.err).Error("yaml decode failed")