forked from honeycombio/libhoney-go
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwriter.go
37 lines (32 loc) · 1018 Bytes
/
writer.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
package libhoney
import (
"github.com/honeycombio/libhoney-go/transmission"
)
// WriterOutput implements the Output interface and passes it along to the
// transmission.WriterSender.
//
// Deprecated: Please use the transmission.WriterSender directly instead.
// It is provided here for backwards compatibility and will be removed eventually.
type WriterOutput struct {
transmission.WriterSender
}
func (w *WriterOutput) 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.WriterSender.Add(transEv)
}
// DiscardWriter implements the Output interface and drops all events.
//
// Deprecated: Please use the transmission.DiscardSender directly instead.
// It is provided here for backwards compatibility and will be removed eventually.
type DiscardOutput struct {
WriterOutput
}
func (d *DiscardOutput) Add(ev *Event) {}