mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-19 05:03:55 +00:00
move init functions to top of file
This commit is contained in:
@@ -14,6 +14,16 @@ type OSCMessageEncode struct {
|
||||
config config.ProcessorConfig
|
||||
}
|
||||
|
||||
func init() {
|
||||
RegisterProcessor(ProcessorRegistration{
|
||||
Type: "osc.message.encode",
|
||||
Title: "Encode OSC Message",
|
||||
New: func(config config.ProcessorConfig) (Processor, error) {
|
||||
return &OSCMessageEncode{config: config}, nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func (ome *OSCMessageEncode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
||||
payload := wrappedPayload.Payload
|
||||
payloadMessage, ok := common.GetAnyAs[*osc.OSCMessage](payload)
|
||||
@@ -35,13 +45,3 @@ func (ome *OSCMessageEncode) Process(ctx context.Context, wrappedPayload common.
|
||||
func (ome *OSCMessageEncode) Type() string {
|
||||
return ome.config.Type
|
||||
}
|
||||
|
||||
func init() {
|
||||
RegisterProcessor(ProcessorRegistration{
|
||||
Type: "osc.message.encode",
|
||||
Title: "Encode OSC Message",
|
||||
New: func(config config.ProcessorConfig) (Processor, error) {
|
||||
return &OSCMessageEncode{config: config}, nil
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user