mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-09-08 14:48:59 +00:00
move init functions to top of file
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user