move init functions to top of file

This commit is contained in:
Joel Wetzell
2026-05-22 17:45:03 -05:00
parent fb3c775765
commit 4323a21015
67 changed files with 1706 additions and 1706 deletions
+14 -14
View File
@@ -10,20 +10,6 @@ import (
"github.com/jwetzell/showbridge-go/internal/config"
)
type TimeSleep struct {
config config.ProcessorConfig
Duration time.Duration
}
func (ts *TimeSleep) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
time.Sleep(ts.Duration)
return wrappedPayload, nil
}
func (ts *TimeSleep) Type() string {
return ts.config.Type
}
func init() {
RegisterProcessor(ProcessorRegistration{
Type: "time.sleep",
@@ -52,3 +38,17 @@ func init() {
},
})
}
type TimeSleep struct {
config config.ProcessorConfig
Duration time.Duration
}
func (ts *TimeSleep) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
time.Sleep(ts.Duration)
return wrappedPayload, nil
}
func (ts *TimeSleep) Type() string {
return ts.config.Type
}