From d7922cc7c5ececf8b8ecfedabcb47532492235b6 Mon Sep 17 00:00:00 2001 From: cam Date: Mon, 10 Feb 2020 15:15:23 +1300 Subject: [PATCH] Use new event-store module --- audioBaitEventRecorder.go | 18 ++++++++---------- go.mod | 3 +++ go.sum | 6 ++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/audioBaitEventRecorder.go b/audioBaitEventRecorder.go index fef72bb..8d4ee98 100644 --- a/audioBaitEventRecorder.go +++ b/audioBaitEventRecorder.go @@ -22,7 +22,7 @@ import ( "log" "time" - "github.com/TheCacophonyProject/event-reporter/eventstore" + "github.com/TheCacophonyProject/event-reporter/eventclient" ) // AudioBaitEventRecorder uses the event api to record that audioBait was played at a particular time. @@ -31,18 +31,16 @@ type AudioBaitEventRecorder struct { // OnAudioBaitPlayed logs an occurrence of an audiobait being played. func (er AudioBaitEventRecorder) OnAudioBaitPlayed(ts time.Time, fileID int, volume int) { - event := eventstore.Event{ - Description: eventstore.EventDescription{ - Type: "audioBait", - Details: map[string]interface{}{ - "fileId": fileID, - "volume": volume, - }, - }, + event := eventclient.Event{ Timestamp: ts, + Type: "audioBait", + Details: map[string]interface{}{ + "fileId": fileID, + "volume": volume, + }, } - if err := eventstore.AddEvent(event); err != nil { + if err := eventclient.AddEvent(event); err != nil { log.Println(err) } } diff --git a/go.mod b/go.mod index 11feb30..341961a 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/TheCacophonyProject/audiobait go 1.12 require ( + github.com/TheCacophonyProject/event-reporter v1.3.2-0.20200210010421-ca3fcb76a231 github.com/TheCacophonyProject/go-api v0.0.0-20190923033957-174cea2ac81c github.com/TheCacophonyProject/go-config v0.0.0-20190927054511-c93578ae648a github.com/TheCacophonyProject/modemd v0.0.0-20190708011609-1940f5b6677b @@ -13,3 +14,5 @@ require ( golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) + +//replace github.com/TheCacophonyProject/event-reporter => /home/cam/gohack/github.com/TheCacophonyProject/event-reporter diff --git a/go.sum b/go.sum index 05fe143..c03ab16 100644 --- a/go.sum +++ b/go.sum @@ -5,11 +5,14 @@ github.com/Masterminds/glide v0.13.2/go.mod h1:STyF5vcenH/rUqTEv+/hBXlSTo7KYwg2o github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/TheCacophonyProject/event-reporter v1.3.2-0.20200210010421-ca3fcb76a231 h1:nLqfSx3zDBzghlP/S8X2j/WRtW0e3BZvSkMm1J/Fa8U= +github.com/TheCacophonyProject/event-reporter v1.3.2-0.20200210010421-ca3fcb76a231/go.mod h1:kei6S/4x+VHp5yiwYPqvcNnhuRpZ8iLsh95Sue6kPvc= github.com/TheCacophonyProject/go-api v0.0.0-20190923033957-174cea2ac81c h1:oe4aAqyfuxwiVbgn2UpslZ6oUlJSNE0cU0TAR8G5k/c= github.com/TheCacophonyProject/go-api v0.0.0-20190923033957-174cea2ac81c/go.mod h1:FfMpa4cFhNXQ9tuKG18HO6yLExezcJhzjUjBOFocrQw= github.com/TheCacophonyProject/go-config v0.0.0-20190922224052-7c2a21bc6b88/go.mod h1:gPUJLVu408NRz9/P3BrsxzOzLc+KJLrv+jVdDw3RI0Y= github.com/TheCacophonyProject/go-config v0.0.0-20190927054511-c93578ae648a h1:Akh0hzvoQuoB+4K7DFhLEYwsIPC0Mju5tY/la6PsVdY= github.com/TheCacophonyProject/go-config v0.0.0-20190927054511-c93578ae648a/go.mod h1:QCgT+KCrz1CmLVpeeOMl5L8/X1QvWwpsLzR7afTmEJc= +github.com/TheCacophonyProject/modemd v0.0.0-20190605010435-ae5b0f2eb760/go.mod h1:bfwJ/WcvDY9XtHKC5tcRfVrU8RWaW8DLYAAUfsrJr/4= github.com/TheCacophonyProject/modemd v0.0.0-20190708011609-1940f5b6677b h1:iJVZlC3nzjJ2EoWLBr7zKhL7t9hUleghmUIC+3ObB88= github.com/TheCacophonyProject/modemd v0.0.0-20190708011609-1940f5b6677b/go.mod h1:txGgnRinv6H0/jB4n71MpuS+2qtu8tAlntIjY5udXDU= github.com/TheCacophonyProject/window v0.0.0-20190821235241-ab92c2ee24b6 h1:aLER2Au+/pJe9FzTW7lmQJIOLO8bgio5i/Uzx/EGEmE= @@ -25,6 +28,8 @@ github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxj github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= @@ -162,6 +167,7 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190318195719-6c81ef8f67ca/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8 h1:41hwlulw1prEMBxLQSlMSux1zxJf07B3WPsdjJlKZxE= golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=