-
Notifications
You must be signed in to change notification settings - Fork 25
/
noop_processor.go
53 lines (42 loc) · 1.09 KB
/
noop_processor.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
43
44
45
46
47
48
49
50
51
52
53
package noop
import (
"context"
_ "embed" // used to embed config
"github.com/sirupsen/logrus"
"github.com/algorand/conduit/conduit/data"
"github.com/algorand/conduit/conduit/plugins"
"github.com/algorand/conduit/conduit/plugins/processors"
)
// PluginName to use when configuring.
const PluginName = "noop"
// package-wide init function
func init() {
processors.Register(PluginName, processors.ProcessorConstructorFunc(func() processors.Processor {
return &Processor{}
}))
}
// Processor noop
type Processor struct{}
//go:embed sample.yaml
var sampleConfig string
// Metadata noop
func (p *Processor) Metadata() plugins.Metadata {
return plugins.Metadata{
Name: PluginName,
Description: "noop processor",
Deprecated: false,
SampleConfig: sampleConfig,
}
}
// Init noop
func (p *Processor) Init(_ context.Context, _ data.InitProvider, _ plugins.PluginConfig, _ *logrus.Logger) error {
return nil
}
// Close noop
func (p *Processor) Close() error {
return nil
}
// Process noop
func (p *Processor) Process(input data.BlockData) (data.BlockData, error) {
return input, nil
}