-
Notifications
You must be signed in to change notification settings - Fork 0
/
dummy.go
34 lines (27 loc) · 985 Bytes
/
dummy.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
package exporters
import (
"github.com/learnitall/gobench/define"
)
// DummyExporter is an exporter that does nothing and returns no errors.
// Used as a place-holder when no exporters are configured.
type DummyExporter struct{}
// Setup creates a new array to hold json documents to-be-printed.
func (de *DummyExporter) Setup(cfg *define.Config) error {
return nil
}
// Healthcheck returns nil, no healthcheck needs to be performed for the json exporter.
func (de *DummyExporter) Healthcheck() error {
return nil
}
// Marshal turns the given payload into pretty-formatted json.
func (de *DummyExporter) Marshal(payload interface{}) ([]byte, error) {
return []byte{}, nil
}
// Export saves the given document, which will be printed when Teardown is called.
func (de *DummyExporter) Export(payload []byte) error {
return nil
}
// Teardown joins all the given documents to export into an array and prints the result.
func (de *DummyExporter) Teardown() error {
return nil
}