Updated main.go to register the postgres and NATS sinks in addition to the stdout sink.
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
@@ -40,12 +40,17 @@ func main() {
|
||||
srcReg := fksources.NewRegistry()
|
||||
wfsources.RegisterBuiltins(srcReg)
|
||||
|
||||
// Minimal sink set to compile: stdout only.
|
||||
// Compile stdout, Postgres, and NATS sinks for weatherfeeder. The former is useful for debugging and the latter are the main intended outputs.
|
||||
sinkReg := fksinks.NewRegistry()
|
||||
sinkReg.Register("stdout", func(cfg config.SinkConfig) (fksinks.Sink, error) {
|
||||
return fksinks.NewStdoutSink(cfg.Name), nil
|
||||
})
|
||||
|
||||
sinkReg.Register("postgres", func(cfg config.SinkConfig) (fksinks.Sink, error) {
|
||||
return fksinks.NewPostgresSinkFromConfig(cfg)
|
||||
})
|
||||
sinkReg.Register("nats", func(cfg config.SinkConfig) (fksinks.Sink, error) {
|
||||
return fksinks.NewNATSSinkFromConfig(cfg)
|
||||
})
|
||||
// --- Build sources into scheduler jobs ---
|
||||
var jobs []fkscheduler.Job
|
||||
for i, sc := range cfg.Sources {
|
||||
|
||||
Reference in New Issue
Block a user