forked from honeycombio/libhoney-go
-
Notifications
You must be signed in to change notification settings - Fork 3
/
mockoutput.go
42 lines (38 loc) · 1.06 KB
/
mockoutput.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package libhoney
import "github.com/honeycombio/libhoney-go/transmission"
// MockOutput implements the Output interface and passes it along to the
// transmission.MockSender.
//
// Deprecated: Please use the transmission.MockSender directly instead.
// It is provided here for backwards compatibility and will be removed eventually.
type MockOutput struct {
transmission.MockSender
}
func (w *MockOutput) Add(ev *Event) {
transEv := &transmission.Event{
APIHost: ev.APIHost,
//APIKey: ev.WriteKey,
Dataset: ev.Dataset,
SampleRate: ev.SampleRate,
Timestamp: ev.Timestamp,
Metadata: ev.Metadata,
Data: ev.data,
}
w.MockSender.Add(transEv)
}
//func (w *MockOutput) Events() []*Event {
// evs := []*Event{}
// for _, ev := range w.MockSender.Events() {
// transEv := &Event{
// APIHost: ev.APIHost,
// //WriteKey: ev.APIKey,
// Dataset: ev.Dataset,
// SampleRate: ev.SampleRate,
// Timestamp: ev.Timestamp,
// Metadata: ev.Metadata,
// }
// transEv.data = ev.Data
// evs = append(evs, transEv)
// }
// return evs
//}