From 54ada59f6e4592229d5c4615d310847a9c2893e6 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Fri, 28 Aug 2026 14:55:19 -0500 Subject: [PATCH] add id getter for processors --- internal/processor/artnet-packet-decode.go | 6 +- internal/processor/artnet-packet-encode.go | 4 ++ internal/processor/db-query.go | 4 ++ internal/processor/debug-log.go | 5 +- internal/processor/filter-change.go | 4 ++ internal/processor/filter-expr.go | 4 ++ internal/processor/filter-rate.go | 4 ++ internal/processor/filter-regex.go | 4 ++ internal/processor/float-parse.go | 4 ++ internal/processor/float-random.go | 4 ++ internal/processor/free-d-create.go | 62 ++++++++++--------- internal/processor/free-d-decode.go | 8 ++- internal/processor/free-d-encode.go | 4 ++ internal/processor/http-request-do.go | 4 ++ internal/processor/http-response-create.go | 4 ++ internal/processor/int-parse.go | 4 ++ internal/processor/int-random.go | 4 ++ internal/processor/int-scale.go | 4 ++ internal/processor/json-decode.go | 4 ++ internal/processor/json-encode.go | 4 ++ internal/processor/kv-get.go | 4 ++ internal/processor/kv-set.go | 4 ++ .../processor/midi-control_change-create.go | 4 ++ internal/processor/midi-message-decode.go | 4 ++ internal/processor/midi-message-encode.go | 4 ++ internal/processor/midi-message-unpack.go | 4 ++ internal/processor/midi-note_off-create.go | 4 ++ internal/processor/midi-note_on-create.go | 4 ++ .../processor/midi-program_change-create.go | 4 ++ internal/processor/module-output.go | 4 ++ internal/processor/osc-message-create.go | 4 ++ internal/processor/osc-message-decode.go | 4 ++ internal/processor/osc-message-encode.go | 4 ++ internal/processor/processor.go | 1 + internal/processor/pubsub-publish.go | 4 ++ internal/processor/router-input.go | 4 ++ internal/processor/script-expr.go | 4 ++ internal/processor/script-js.go | 4 ++ internal/processor/script-wasm.go | 4 ++ .../processor/sip-response-audio-create.go | 4 ++ .../processor/sip-response-dtmf-create.go | 4 ++ internal/processor/string-create.go | 4 ++ internal/processor/string-decode.go | 4 ++ internal/processor/string-encode.go | 4 ++ internal/processor/string-split.go | 4 ++ internal/processor/struct-field-get.go | 4 ++ internal/processor/struct-method-get.go | 4 ++ .../test/artnet-packet-decode_test.go | 5 ++ .../test/artnet-packet-encode_test.go | 5 ++ internal/processor/test/db-query_test.go | 5 ++ internal/processor/test/debug-log_test.go | 5 ++ internal/processor/test/filter-change_test.go | 5 ++ internal/processor/test/filter-expr_test.go | 5 ++ internal/processor/test/filter-rate_test.go | 5 ++ internal/processor/test/filter-regex_test.go | 5 ++ internal/processor/test/float-parse_test.go | 4 ++ internal/processor/test/float-random_test.go | 5 ++ internal/processor/test/free-d-create_test.go | 5 ++ internal/processor/test/free-d-decode_test.go | 5 ++ internal/processor/test/free-d-encode_test.go | 5 ++ .../processor/test/http-request-do_test.go | 5 ++ .../test/http-response-create_test.go | 5 ++ internal/processor/test/int-parse_test.go | 5 ++ internal/processor/test/int-random_test.go | 5 ++ internal/processor/test/int-scale_test.go | 5 ++ internal/processor/test/json-decode_test.go | 5 ++ internal/processor/test/json-encode_test.go | 5 ++ internal/processor/test/kv-get_test.go | 5 ++ internal/processor/test/kv-set_test.go | 4 ++ .../test/midi-control_change-create_test.go | 5 ++ .../test/midi-message-decode_test.go | 5 ++ .../test/midi-message-encode_test.go | 5 ++ .../test/midi-message-unpack_test.go | 4 ++ .../test/midi-note_off-create_test.go | 4 ++ .../test/midi-note_on-create_test.go | 5 ++ .../test/midi-program_change-create_test.go | 5 ++ internal/processor/test/module-output_test.go | 5 ++ .../processor/test/osc-message-create_test.go | 5 ++ .../processor/test/osc-message-decode_test.go | 5 ++ .../processor/test/osc-message-encode_test.go | 5 ++ .../processor/test/pubsub-publish_test.go | 5 ++ internal/processor/test/router-input_test.go | 5 ++ internal/processor/test/script-expr_test.go | 5 ++ internal/processor/test/script-js_test.go | 5 ++ internal/processor/test/script-wasm_test.go | 5 ++ .../test/sip-response-audio-create_test.go | 5 ++ .../test/sip-response-dtmf-create_test.go | 5 ++ internal/processor/test/string-create_test.go | 5 ++ internal/processor/test/string-decode_test.go | 5 ++ internal/processor/test/string-encode_test.go | 5 ++ internal/processor/test/string-split_test.go | 5 ++ .../processor/test/struct-field-get_test.go | 5 ++ .../processor/test/struct-method-get_test.go | 5 ++ internal/processor/test/time-sleep_test.go | 5 ++ internal/processor/time-sleep.go | 4 ++ internal/test/processor.go | 4 ++ 96 files changed, 456 insertions(+), 33 deletions(-) diff --git a/internal/processor/artnet-packet-decode.go b/internal/processor/artnet-packet-decode.go index 85c0917..b2ac375 100644 --- a/internal/processor/artnet-packet-decode.go +++ b/internal/processor/artnet-packet-decode.go @@ -44,6 +44,10 @@ func (apd *ArtNetPacketDecode) Process(ctx context.Context, wrappedPayload commo return wrappedPayload, nil } +func (apd *ArtNetPacketDecode) Id() string { + return apd.config.Id +} + func (apd *ArtNetPacketDecode) Type() string { return apd.config.Type -} \ No newline at end of file +} diff --git a/internal/processor/artnet-packet-encode.go b/internal/processor/artnet-packet-encode.go index a8cbaf1..1a42b1f 100644 --- a/internal/processor/artnet-packet-encode.go +++ b/internal/processor/artnet-packet-encode.go @@ -43,6 +43,10 @@ func (ape *ArtNetPacketEncode) Process(ctx context.Context, wrappedPayload commo return wrappedPayload, nil } +func (ape *ArtNetPacketEncode) Id() string { + return ape.config.Id +} + func (ape *ArtNetPacketEncode) Type() string { return ape.config.Type } diff --git a/internal/processor/db-query.go b/internal/processor/db-query.go index 1e38d74..2f35bc6 100644 --- a/internal/processor/db-query.go +++ b/internal/processor/db-query.go @@ -143,6 +143,10 @@ func (dq *DbQuery) Process(ctx context.Context, wrappedPayload common.WrappedPay return wrappedPayload, nil } +func (dq *DbQuery) Id() string { + return dq.config.Id +} + func (dq *DbQuery) Type() string { return dq.config.Type } diff --git a/internal/processor/debug-log.go b/internal/processor/debug-log.go index 6895e11..3d2004d 100644 --- a/internal/processor/debug-log.go +++ b/internal/processor/debug-log.go @@ -33,7 +33,10 @@ func (dl *DebugLog) Process(ctx context.Context, wrappedPayload common.WrappedPa return wrappedPayload, nil } +func (dl *DebugLog) Id() string { + return dl.config.Id +} + func (dl *DebugLog) Type() string { return dl.config.Type } - diff --git a/internal/processor/filter-change.go b/internal/processor/filter-change.go index 24367c1..d57a162 100644 --- a/internal/processor/filter-change.go +++ b/internal/processor/filter-change.go @@ -35,6 +35,10 @@ func (fc *FilterChange) Process(ctx context.Context, wrappedPayload common.Wrapp return wrappedPayload, nil } +func (fc *FilterChange) Id() string { + return fc.config.Id +} + func (fc *FilterChange) Type() string { return fc.config.Type } diff --git a/internal/processor/filter-expr.go b/internal/processor/filter-expr.go index 61bf70a..68e8107 100644 --- a/internal/processor/filter-expr.go +++ b/internal/processor/filter-expr.go @@ -76,6 +76,10 @@ func (fe *FilterExpr) Process(ctx context.Context, wrappedPayload common.Wrapped return wrappedPayload, nil } +func (fe *FilterExpr) Id() string { + return fe.config.Id +} + func (fe *FilterExpr) Type() string { return fe.config.Type } diff --git a/internal/processor/filter-rate.go b/internal/processor/filter-rate.go index 701f3bd..9445bf6 100644 --- a/internal/processor/filter-rate.go +++ b/internal/processor/filter-rate.go @@ -53,6 +53,10 @@ func (fc *FilterRate) Process(ctx context.Context, wrappedPayload common.Wrapped return wrappedPayload, nil } +func (fc *FilterRate) Id() string { + return fc.config.Id +} + func (fc *FilterRate) Type() string { return fc.config.Type } diff --git a/internal/processor/filter-regex.go b/internal/processor/filter-regex.go index c658813..e2316eb 100644 --- a/internal/processor/filter-regex.go +++ b/internal/processor/filter-regex.go @@ -69,6 +69,10 @@ func (fr *FilterRegex) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, nil } +func (fr *FilterRegex) Id() string { + return fr.config.Id +} + func (fr *FilterRegex) Type() string { return fr.config.Type } diff --git a/internal/processor/float-parse.go b/internal/processor/float-parse.go index 2362a6f..1654fc5 100644 --- a/internal/processor/float-parse.go +++ b/internal/processor/float-parse.go @@ -68,6 +68,10 @@ func (fp *FloatParse) Process(ctx context.Context, wrappedPayload common.Wrapped return wrappedPayload, nil } +func (fp *FloatParse) Id() string { + return fp.config.Id +} + func (fp *FloatParse) Type() string { return fp.config.Type } diff --git a/internal/processor/float-random.go b/internal/processor/float-random.go index 2525bf0..6eb1d94 100644 --- a/internal/processor/float-random.go +++ b/internal/processor/float-random.go @@ -97,6 +97,10 @@ func (fr *FloatRandom) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, errors.New("float.random bitSize error: must be 32 or 64") } +func (fr *FloatRandom) Id() string { + return fr.config.Id +} + func (fr *FloatRandom) Type() string { return fr.config.Type } diff --git a/internal/processor/free-d-create.go b/internal/processor/free-d-create.go index dcb5922..6bd9f94 100644 --- a/internal/processor/free-d-create.go +++ b/internal/processor/free-d-create.go @@ -182,32 +182,32 @@ func init() { } return &FreeDCreate{ - config: config, - Id: idTemplate, - Pan: panTemplate, - Tilt: tiltTemplate, - Roll: rollTemplate, - PosX: posXTemplate, - PosY: posYTemplate, - PosZ: posZTemplate, - Zoom: zoomTemplate, - Focus: focusTemplate, + config: config, + IdTemplate: idTemplate, + PanTemplate: panTemplate, + TiltTemplate: tiltTemplate, + RollTemplate: rollTemplate, + PosXTemplate: posXTemplate, + PosYTemplate: posYTemplate, + PosZTemplate: posZTemplate, + ZoomTemplate: zoomTemplate, + FocusTemplate: focusTemplate, }, nil }, }) } type FreeDCreate struct { - config config.ProcessorConfig - Id *template.Template - Pan *template.Template - Tilt *template.Template - Roll *template.Template - PosX *template.Template - PosY *template.Template - PosZ *template.Template - Zoom *template.Template - Focus *template.Template + config config.ProcessorConfig + IdTemplate *template.Template + PanTemplate *template.Template + TiltTemplate *template.Template + RollTemplate *template.Template + PosXTemplate *template.Template + PosYTemplate *template.Template + PosZTemplate *template.Template + ZoomTemplate *template.Template + FocusTemplate *template.Template } func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { @@ -215,7 +215,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe templateData := wrappedPayload var idBuffer bytes.Buffer - err := fc.Id.Execute(&idBuffer, templateData) + err := fc.IdTemplate.Execute(&idBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -232,7 +232,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var panBuffer bytes.Buffer - err = fc.Pan.Execute(&panBuffer, templateData) + err = fc.PanTemplate.Execute(&panBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -249,7 +249,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var tiltBuffer bytes.Buffer - err = fc.Tilt.Execute(&tiltBuffer, templateData) + err = fc.TiltTemplate.Execute(&tiltBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -266,7 +266,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var rollBuffer bytes.Buffer - err = fc.Roll.Execute(&rollBuffer, templateData) + err = fc.RollTemplate.Execute(&rollBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -283,7 +283,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var posXBuffer bytes.Buffer - err = fc.PosX.Execute(&posXBuffer, templateData) + err = fc.PosXTemplate.Execute(&posXBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -300,7 +300,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var posYBuffer bytes.Buffer - err = fc.PosY.Execute(&posYBuffer, templateData) + err = fc.PosYTemplate.Execute(&posYBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -317,7 +317,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var posZBuffer bytes.Buffer - err = fc.PosZ.Execute(&posZBuffer, templateData) + err = fc.PosZTemplate.Execute(&posZBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -334,7 +334,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var zoomBuffer bytes.Buffer - err = fc.Zoom.Execute(&zoomBuffer, templateData) + err = fc.ZoomTemplate.Execute(&zoomBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -351,7 +351,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe } var focusBuffer bytes.Buffer - err = fc.Focus.Execute(&focusBuffer, templateData) + err = fc.FocusTemplate.Execute(&focusBuffer, templateData) if err != nil { wrappedPayload.End = true @@ -384,6 +384,10 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, nil } +func (fc *FreeDCreate) Id() string { + return fc.config.Id +} + func (fc *FreeDCreate) Type() string { return fc.config.Type } diff --git a/internal/processor/free-d-decode.go b/internal/processor/free-d-decode.go index 18f8464..4e75ed7 100644 --- a/internal/processor/free-d-decode.go +++ b/internal/processor/free-d-decode.go @@ -21,9 +21,9 @@ func init() { type FreeDDecode struct { config config.ProcessorConfig - buf [29]byte + buf [29]byte } - + func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) { payload := wrappedPayload.Payload payloadBytes, ok := common.GetAnyAsByteSlice(payload) @@ -49,6 +49,10 @@ func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, nil } +func (fd *FreeDDecode) Id() string { + return fd.config.Id +} + func (fd *FreeDDecode) Type() string { return fd.config.Type } diff --git a/internal/processor/free-d-encode.go b/internal/processor/free-d-encode.go index 6ea6309..5d0d1ce 100644 --- a/internal/processor/free-d-encode.go +++ b/internal/processor/free-d-encode.go @@ -38,6 +38,10 @@ func (fe *FreeDEncode) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, nil } +func (fe *FreeDEncode) Id() string { + return fe.config.Id +} + func (fe *FreeDEncode) Type() string { return fe.config.Type } diff --git a/internal/processor/http-request-do.go b/internal/processor/http-request-do.go index 06f027d..becaad2 100644 --- a/internal/processor/http-request-do.go +++ b/internal/processor/http-request-do.go @@ -114,6 +114,10 @@ func (hrd *HTTPRequestDo) Process(ctx context.Context, wrappedPayload common.Wra return wrappedPayload, nil } +func (hrd *HTTPRequestDo) Id() string { + return hrd.config.Id +} + func (hrd *HTTPRequestDo) Type() string { return hrd.config.Type } diff --git a/internal/processor/http-response-create.go b/internal/processor/http-response-create.go index 566de6c..f165d58 100644 --- a/internal/processor/http-response-create.go +++ b/internal/processor/http-response-create.go @@ -85,6 +85,10 @@ func (hrc *HTTPResponseCreate) Process(ctx context.Context, wrappedPayload commo return wrappedPayload, nil } +func (hrc *HTTPResponseCreate) Id() string { + return hrc.config.Id +} + func (hrc *HTTPResponseCreate) Type() string { return hrc.config.Type } diff --git a/internal/processor/int-parse.go b/internal/processor/int-parse.go index 0f6b532..3168482 100644 --- a/internal/processor/int-parse.go +++ b/internal/processor/int-parse.go @@ -85,6 +85,10 @@ func (ip *IntParse) Process(ctx context.Context, wrappedPayload common.WrappedPa return wrappedPayload, nil } +func (ip *IntParse) Id() string { + return ip.config.Id +} + func (ip *IntParse) Type() string { return ip.config.Type } diff --git a/internal/processor/int-random.go b/internal/processor/int-random.go index 833d1f9..4bbe3bc 100644 --- a/internal/processor/int-random.go +++ b/internal/processor/int-random.go @@ -66,6 +66,10 @@ func (ir *IntRandom) Process(ctx context.Context, wrappedPayload common.WrappedP return wrappedPayload, nil } +func (ir *IntRandom) Id() string { + return ir.config.Id +} + func (ir *IntRandom) Type() string { return ir.config.Type } diff --git a/internal/processor/int-scale.go b/internal/processor/int-scale.go index 5ada80a..5427768 100644 --- a/internal/processor/int-scale.go +++ b/internal/processor/int-scale.go @@ -98,6 +98,10 @@ func (is *IntScale) Process(ctx context.Context, wrappedPayload common.WrappedPa return wrappedPayload, nil } +func (is *IntScale) Id() string { + return is.config.Id +} + func (is *IntScale) Type() string { return is.config.Type } diff --git a/internal/processor/json-decode.go b/internal/processor/json-decode.go index 9fe492b..69cba4e 100644 --- a/internal/processor/json-decode.go +++ b/internal/processor/json-decode.go @@ -50,6 +50,10 @@ func (jd *JsonDecode) Process(ctx context.Context, wrappedPayload common.Wrapped } +func (jd *JsonDecode) Id() string { + return jd.config.Id +} + func (jd *JsonDecode) Type() string { return jd.config.Type } diff --git a/internal/processor/json-encode.go b/internal/processor/json-encode.go index b7c1ac8..64e47bb 100644 --- a/internal/processor/json-encode.go +++ b/internal/processor/json-encode.go @@ -42,6 +42,10 @@ func (je *JsonEncode) Process(ctx context.Context, wrappedPayload common.Wrapped return wrappedPayload, nil } +func (je *JsonEncode) Id() string { + return je.config.Id +} + func (je *JsonEncode) Type() string { return je.config.Type } diff --git a/internal/processor/kv-get.go b/internal/processor/kv-get.go index 4d4174a..5f24567 100644 --- a/internal/processor/kv-get.go +++ b/internal/processor/kv-get.go @@ -89,6 +89,10 @@ func (kvg *KVGet) Process(ctx context.Context, wrappedPayload common.WrappedPayl return wrappedPayload, nil } +func (kvg *KVGet) Id() string { + return kvg.config.Id +} + func (kvg *KVGet) Type() string { return kvg.config.Type } diff --git a/internal/processor/kv-set.go b/internal/processor/kv-set.go index e7cbc77..d8ce210 100644 --- a/internal/processor/kv-set.go +++ b/internal/processor/kv-set.go @@ -89,6 +89,10 @@ func (kvs *KVSet) Process(ctx context.Context, wrappedPayload common.WrappedPayl return wrappedPayload, nil } +func (kvs *KVSet) Id() string { + return kvs.config.Id +} + func (kvs *KVSet) Type() string { return kvs.config.Type } diff --git a/internal/processor/midi-control_change-create.go b/internal/processor/midi-control_change-create.go index 3eae756..00bf873 100644 --- a/internal/processor/midi-control_change-create.go +++ b/internal/processor/midi-control_change-create.go @@ -147,6 +147,10 @@ func (mccc *MIDIControlChangeCreate) Process(ctx context.Context, wrappedPayload return wrappedPayload, nil } +func (mccc *MIDIControlChangeCreate) Id() string { + return mccc.config.Id +} + func (mccc *MIDIControlChangeCreate) Type() string { return mccc.config.Type } diff --git a/internal/processor/midi-message-decode.go b/internal/processor/midi-message-decode.go index 6b56a40..4761283 100644 --- a/internal/processor/midi-message-decode.go +++ b/internal/processor/midi-message-decode.go @@ -40,6 +40,10 @@ func (mmd *MIDIMessageDecode) Process(ctx context.Context, wrappedPayload common return wrappedPayload, nil } +func (mmd *MIDIMessageDecode) Id() string { + return mmd.config.Id +} + func (mmd *MIDIMessageDecode) Type() string { return mmd.config.Type } diff --git a/internal/processor/midi-message-encode.go b/internal/processor/midi-message-encode.go index 99b1433..6c6d72f 100644 --- a/internal/processor/midi-message-encode.go +++ b/internal/processor/midi-message-encode.go @@ -38,6 +38,10 @@ func (mme *MIDIMessageEncode) Process(ctx context.Context, wrappedPayload common return wrappedPayload, nil } +func (mme *MIDIMessageEncode) Id() string { + return mme.config.Id +} + func (mme *MIDIMessageEncode) Type() string { return mme.config.Type } diff --git a/internal/processor/midi-message-unpack.go b/internal/processor/midi-message-unpack.go index a16c869..539a299 100644 --- a/internal/processor/midi-message-unpack.go +++ b/internal/processor/midi-message-unpack.go @@ -96,6 +96,10 @@ func (mmu *MIDIMessageUnpack) Process(ctx context.Context, wrappedPayload common } } +func (mmu *MIDIMessageUnpack) Id() string { + return mmu.config.Id +} + func (mmu *MIDIMessageUnpack) Type() string { return mmu.config.Type } diff --git a/internal/processor/midi-note_off-create.go b/internal/processor/midi-note_off-create.go index 12d55af..b8eb539 100644 --- a/internal/processor/midi-note_off-create.go +++ b/internal/processor/midi-note_off-create.go @@ -146,6 +146,10 @@ func (mnoc *MIDINoteOffCreate) Process(ctx context.Context, wrappedPayload commo return wrappedPayload, nil } +func (mnoc *MIDINoteOffCreate) Id() string { + return mnoc.config.Id +} + func (mnoc *MIDINoteOffCreate) Type() string { return mnoc.config.Type } diff --git a/internal/processor/midi-note_on-create.go b/internal/processor/midi-note_on-create.go index 69aa15d..705c975 100644 --- a/internal/processor/midi-note_on-create.go +++ b/internal/processor/midi-note_on-create.go @@ -145,6 +145,10 @@ func (mnoc *MIDINoteOnCreate) Process(ctx context.Context, wrappedPayload common return wrappedPayload, nil } +func (mnoc *MIDINoteOnCreate) Id() string { + return mnoc.config.Id +} + func (mnoc *MIDINoteOnCreate) Type() string { return mnoc.config.Type } diff --git a/internal/processor/midi-program_change-create.go b/internal/processor/midi-program_change-create.go index fed1c44..f1fe951 100644 --- a/internal/processor/midi-program_change-create.go +++ b/internal/processor/midi-program_change-create.go @@ -113,6 +113,10 @@ func (mpcc *MIDIProgramChangeCreate) Process(ctx context.Context, wrappedPayload return wrappedPayload, nil } +func (mpcc *MIDIProgramChangeCreate) Id() string { + return mpcc.config.Id +} + func (mpcc *MIDIProgramChangeCreate) Type() string { return mpcc.config.Type } diff --git a/internal/processor/module-output.go b/internal/processor/module-output.go index 7ce7ecc..c9a79ee 100644 --- a/internal/processor/module-output.go +++ b/internal/processor/module-output.go @@ -81,6 +81,10 @@ func (mo *ModuleOutput) Process(ctx context.Context, wrappedPayload common.Wrapp return wrappedPayload, nil } +func (mo *ModuleOutput) Id() string { + return mo.config.Id +} + func (mo *ModuleOutput) Type() string { return mo.config.Type } diff --git a/internal/processor/osc-message-create.go b/internal/processor/osc-message-create.go index 595a196..0509b92 100644 --- a/internal/processor/osc-message-create.go +++ b/internal/processor/osc-message-create.go @@ -157,6 +157,10 @@ func (omc *OSCMessageCreate) Process(ctx context.Context, wrappedPayload common. return wrappedPayload, nil } +func (omc *OSCMessageCreate) Id() string { + return omc.config.Id +} + func (omc *OSCMessageCreate) Type() string { return omc.config.Type } diff --git a/internal/processor/osc-message-decode.go b/internal/processor/osc-message-decode.go index 3a40989..f239aca 100644 --- a/internal/processor/osc-message-decode.go +++ b/internal/processor/osc-message-decode.go @@ -52,6 +52,10 @@ func (omd *OSCMessageDecode) Process(ctx context.Context, wrappedPayload common. return wrappedPayload, nil } +func (omd *OSCMessageDecode) Id() string { + return omd.config.Id +} + func (omd *OSCMessageDecode) Type() string { return omd.config.Type } diff --git a/internal/processor/osc-message-encode.go b/internal/processor/osc-message-encode.go index 74ec952..ec78e68 100644 --- a/internal/processor/osc-message-encode.go +++ b/internal/processor/osc-message-encode.go @@ -42,6 +42,10 @@ func (ome *OSCMessageEncode) Process(ctx context.Context, wrappedPayload common. return wrappedPayload, nil } +func (ome *OSCMessageEncode) Id() string { + return ome.config.Id +} + func (ome *OSCMessageEncode) Type() string { return ome.config.Type } diff --git a/internal/processor/processor.go b/internal/processor/processor.go index 4799f1f..86af9c6 100644 --- a/internal/processor/processor.go +++ b/internal/processor/processor.go @@ -11,6 +11,7 @@ import ( ) type Processor interface { + Id() string Type() string Process(context.Context, common.WrappedPayload) (common.WrappedPayload, error) } diff --git a/internal/processor/pubsub-publish.go b/internal/processor/pubsub-publish.go index 2686aa2..e84905b 100644 --- a/internal/processor/pubsub-publish.go +++ b/internal/processor/pubsub-publish.go @@ -104,6 +104,10 @@ func (psp *PubSubPublish) Process(ctx context.Context, wrappedPayload common.Wra return wrappedPayload, nil } +func (psp *PubSubPublish) Id() string { + return psp.config.Id +} + func (psp *PubSubPublish) Type() string { return psp.config.Type } diff --git a/internal/processor/router-input.go b/internal/processor/router-input.go index ea1ac69..439f6e0 100644 --- a/internal/processor/router-input.go +++ b/internal/processor/router-input.go @@ -68,6 +68,10 @@ func (ri *RouterInput) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, nil } +func (ri *RouterInput) Id() string { + return ri.config.Id +} + func (ri *RouterInput) Type() string { return ri.config.Type } diff --git a/internal/processor/script-expr.go b/internal/processor/script-expr.go index 710cd7a..924fcd2 100644 --- a/internal/processor/script-expr.go +++ b/internal/processor/script-expr.go @@ -65,6 +65,10 @@ func (se *ScriptExpr) Process(ctx context.Context, wrappedPayload common.Wrapped return wrappedPayload, nil } +func (se *ScriptExpr) Id() string { + return se.config.Id +} + func (se *ScriptExpr) Type() string { return se.config.Type } diff --git a/internal/processor/script-js.go b/internal/processor/script-js.go index 3dc80d0..9433827 100644 --- a/internal/processor/script-js.go +++ b/internal/processor/script-js.go @@ -135,6 +135,10 @@ func (sj *ScriptJS) Process(ctx context.Context, wrappedPayload common.WrappedPa return wrappedPayload, nil } +func (sj *ScriptJS) Id() string { + return sj.config.Id +} + func (sj *ScriptJS) Type() string { return sj.config.Type } diff --git a/internal/processor/script-wasm.go b/internal/processor/script-wasm.go index 24ab948..2f60fdf 100644 --- a/internal/processor/script-wasm.go +++ b/internal/processor/script-wasm.go @@ -120,6 +120,10 @@ func (sw *ScriptWASM) Process(ctx context.Context, wrappedPayload common.Wrapped return wrappedPayload, nil } +func (sw *ScriptWASM) Id() string { + return sw.config.Id +} + func (sw *ScriptWASM) Type() string { return sw.config.Type } diff --git a/internal/processor/sip-response-audio-create.go b/internal/processor/sip-response-audio-create.go index 04f0672..390a567 100644 --- a/internal/processor/sip-response-audio-create.go +++ b/internal/processor/sip-response-audio-create.go @@ -100,6 +100,10 @@ func (srac *SipResponseAudioCreate) Process(ctx context.Context, wrappedPayload return wrappedPayload, nil } +func (srac *SipResponseAudioCreate) Id() string { + return srac.config.Id +} + func (srac *SipResponseAudioCreate) Type() string { return srac.config.Type } diff --git a/internal/processor/sip-response-dtmf-create.go b/internal/processor/sip-response-dtmf-create.go index 17eeba2..af0dda9 100644 --- a/internal/processor/sip-response-dtmf-create.go +++ b/internal/processor/sip-response-dtmf-create.go @@ -110,6 +110,10 @@ func (srdc *SipResponseDTMFCreate) Process(ctx context.Context, wrappedPayload c return wrappedPayload, nil } +func (srdc *SipResponseDTMFCreate) Id() string { + return srdc.config.Id +} + func (srdc *SipResponseDTMFCreate) Type() string { return srdc.config.Type } diff --git a/internal/processor/string-create.go b/internal/processor/string-create.go index 0b2740b..3f6d4c3 100644 --- a/internal/processor/string-create.go +++ b/internal/processor/string-create.go @@ -65,6 +65,10 @@ func (sc *StringCreate) Process(ctx context.Context, wrappedPayload common.Wrapp return wrappedPayload, nil } +func (sc *StringCreate) Id() string { + return sc.config.Id +} + func (sc *StringCreate) Type() string { return sc.config.Type } diff --git a/internal/processor/string-decode.go b/internal/processor/string-decode.go index 2cf6bd0..fd6d0de 100644 --- a/internal/processor/string-decode.go +++ b/internal/processor/string-decode.go @@ -37,6 +37,10 @@ func (sd *StringDecode) Process(ctx context.Context, wrappedPayload common.Wrapp return wrappedPayload, nil } +func (sd *StringDecode) Id() string { + return sd.config.Id +} + func (sd *StringDecode) Type() string { return sd.config.Type } diff --git a/internal/processor/string-encode.go b/internal/processor/string-encode.go index 6d76885..7757a85 100644 --- a/internal/processor/string-encode.go +++ b/internal/processor/string-encode.go @@ -36,6 +36,10 @@ func (se *StringEncode) Process(ctx context.Context, wrappedPayload common.Wrapp return wrappedPayload, nil } +func (se *StringEncode) Id() string { + return se.config.Id +} + func (se *StringEncode) Type() string { return se.config.Type } diff --git a/internal/processor/string-split.go b/internal/processor/string-split.go index 5459f0b..59db770 100644 --- a/internal/processor/string-split.go +++ b/internal/processor/string-split.go @@ -59,6 +59,10 @@ func (ss *StringSplit) Process(ctx context.Context, wrappedPayload common.Wrappe return wrappedPayload, nil } +func (ss *StringSplit) Id() string { + return ss.config.Id +} + func (ss *StringSplit) Type() string { return ss.config.Type } diff --git a/internal/processor/struct-field-get.go b/internal/processor/struct-field-get.go index 83bf418..5c1ff36 100644 --- a/internal/processor/struct-field-get.go +++ b/internal/processor/struct-field-get.go @@ -67,6 +67,10 @@ func (sfg *StructFieldGet) Process(ctx context.Context, wrappedPayload common.Wr return wrappedPayload, nil } +func (sfg *StructFieldGet) Id() string { + return sfg.config.Id +} + func (sfg *StructFieldGet) Type() string { return sfg.config.Type } diff --git a/internal/processor/struct-method-get.go b/internal/processor/struct-method-get.go index 3386bbe..6c72834 100644 --- a/internal/processor/struct-method-get.go +++ b/internal/processor/struct-method-get.go @@ -86,6 +86,10 @@ func (smg *StructMethodGet) Process(ctx context.Context, wrappedPayload common.W return wrappedPayload, nil } +func (smg *StructMethodGet) Id() string { + return smg.config.Id +} + func (smg *StructMethodGet) Type() string { return smg.config.Type } diff --git a/internal/processor/test/artnet-packet-decode_test.go b/internal/processor/test/artnet-packet-decode_test.go index d17e16e..8844bad 100644 --- a/internal/processor/test/artnet-packet-decode_test.go +++ b/internal/processor/test/artnet-packet-decode_test.go @@ -17,6 +17,7 @@ func TestArtnetPacketDecodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "artnet.packet.decode", }) @@ -24,6 +25,10 @@ func TestArtnetPacketDecodeFromRegistry(t *testing.T) { t.Fatalf("failed to create artnet.packet.decode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("artnet.packet.decode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "artnet.packet.decode" { t.Fatalf("artnet.packet.decode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/artnet-packet-encode_test.go b/internal/processor/test/artnet-packet-encode_test.go index 28c71a4..6b2faf1 100644 --- a/internal/processor/test/artnet-packet-encode_test.go +++ b/internal/processor/test/artnet-packet-encode_test.go @@ -17,6 +17,7 @@ func TestArtnetPacketEncodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "artnet.packet.encode", }) @@ -24,6 +25,10 @@ func TestArtnetPacketEncodeFromRegistry(t *testing.T) { t.Fatalf("failed to create artnet.packet.encode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("artnet.packet.encode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "artnet.packet.encode" { t.Fatalf("artnet.packet.encode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/db-query_test.go b/internal/processor/test/db-query_test.go index 3b73cd0..03fe3c1 100644 --- a/internal/processor/test/db-query_test.go +++ b/internal/processor/test/db-query_test.go @@ -18,6 +18,7 @@ func TestDbQueryFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "db.query", Params: map[string]any{ "module": "test", @@ -28,6 +29,10 @@ func TestDbQueryFromRegistry(t *testing.T) { t.Fatalf("failed to create db.query processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("db.query processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "db.query" { t.Fatalf("db.query processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/debug-log_test.go b/internal/processor/test/debug-log_test.go index eb7a81d..75222a3 100644 --- a/internal/processor/test/debug-log_test.go +++ b/internal/processor/test/debug-log_test.go @@ -16,6 +16,7 @@ func TestDebugLogFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "debug.log", }) @@ -23,6 +24,10 @@ func TestDebugLogFromRegistry(t *testing.T) { t.Fatalf("failed to create debug.log processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("debug.log processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "debug.log" { t.Fatalf("debug.log processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/filter-change_test.go b/internal/processor/test/filter-change_test.go index 98573fb..121af2f 100644 --- a/internal/processor/test/filter-change_test.go +++ b/internal/processor/test/filter-change_test.go @@ -16,12 +16,17 @@ func TestFilterChangeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "filter.change", }) if err != nil { t.Fatalf("failed to create filter.change processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("filter.change processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "filter.change" { t.Fatalf("filter.change processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/filter-expr_test.go b/internal/processor/test/filter-expr_test.go index 64e7737..53815dc 100644 --- a/internal/processor/test/filter-expr_test.go +++ b/internal/processor/test/filter-expr_test.go @@ -16,6 +16,7 @@ func TestFilterExprFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "filter.expr", Params: map[string]any{ "expression": "foo + bar", @@ -25,6 +26,10 @@ func TestFilterExprFromRegistry(t *testing.T) { t.Fatalf("failed to create filter.expr processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("filter.expr processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "filter.expr" { t.Fatalf("filter.expr processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/filter-rate_test.go b/internal/processor/test/filter-rate_test.go index 63585a8..e25e5c3 100644 --- a/internal/processor/test/filter-rate_test.go +++ b/internal/processor/test/filter-rate_test.go @@ -16,6 +16,7 @@ func TestFilterRateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "filter.rate", Params: map[string]any{ "rate": 1, @@ -25,6 +26,10 @@ func TestFilterRateFromRegistry(t *testing.T) { t.Fatalf("failed to create filter.rate processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("filter.rate processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "filter.rate" { t.Fatalf("filter.rate processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/filter-regex_test.go b/internal/processor/test/filter-regex_test.go index e026576..6b128c1 100644 --- a/internal/processor/test/filter-regex_test.go +++ b/internal/processor/test/filter-regex_test.go @@ -16,6 +16,7 @@ func TestFilterRegexFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "filter.regex", Params: map[string]any{ "pattern": "hello", @@ -25,6 +26,10 @@ func TestFilterRegexFromRegistry(t *testing.T) { t.Fatalf("failed to create filter.regex processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("filter.regex processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "filter.regex" { t.Fatalf("filter.regex processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/float-parse_test.go b/internal/processor/test/float-parse_test.go index 4fcc53d..edc3473 100644 --- a/internal/processor/test/float-parse_test.go +++ b/internal/processor/test/float-parse_test.go @@ -16,6 +16,7 @@ func TestFloatParseFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "float.parse", }) @@ -23,6 +24,9 @@ func TestFloatParseFromRegistry(t *testing.T) { t.Fatalf("failed to create float.parse processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("float.parse processor has wrong id: %s", processorInstance.Id()) + } if processorInstance.Type() != "float.parse" { t.Fatalf("float.parse processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/float-random_test.go b/internal/processor/test/float-random_test.go index b3faec5..09c5e12 100644 --- a/internal/processor/test/float-random_test.go +++ b/internal/processor/test/float-random_test.go @@ -15,6 +15,7 @@ func TestFloatRandomFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "float.random", Params: map[string]any{ "min": 1.0, @@ -26,6 +27,10 @@ func TestFloatRandomFromRegistry(t *testing.T) { t.Fatalf("failed to create float.random processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("float.random processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "float.random" { t.Fatalf("float.random processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/free-d-create_test.go b/internal/processor/test/free-d-create_test.go index 09b1a58..8b4cf8c 100644 --- a/internal/processor/test/free-d-create_test.go +++ b/internal/processor/test/free-d-create_test.go @@ -17,6 +17,7 @@ func TestFreeDCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "freed.create", Params: map[string]any{ "id": "0", @@ -35,6 +36,10 @@ func TestFreeDCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create freed.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("freed.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "freed.create" { t.Fatalf("freed.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/free-d-decode_test.go b/internal/processor/test/free-d-decode_test.go index 6144e0b..5c3f633 100644 --- a/internal/processor/test/free-d-decode_test.go +++ b/internal/processor/test/free-d-decode_test.go @@ -17,6 +17,7 @@ func TestFreeDDecodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "freed.decode", }) @@ -24,6 +25,10 @@ func TestFreeDDecodeFromRegistry(t *testing.T) { t.Fatalf("failed to create freed.decode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("freed.decode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "freed.decode" { t.Fatalf("freed.decode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/free-d-encode_test.go b/internal/processor/test/free-d-encode_test.go index b3c09c0..dc81c31 100644 --- a/internal/processor/test/free-d-encode_test.go +++ b/internal/processor/test/free-d-encode_test.go @@ -17,6 +17,7 @@ func TestFreeDEncodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "freed.encode", }) @@ -24,6 +25,10 @@ func TestFreeDEncodeFromRegistry(t *testing.T) { t.Fatalf("failed to create freed.encode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("freed.encode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "freed.encode" { t.Fatalf("freed.encode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/http-request-do_test.go b/internal/processor/test/http-request-do_test.go index e509fa0..df65f41 100644 --- a/internal/processor/test/http-request-do_test.go +++ b/internal/processor/test/http-request-do_test.go @@ -16,6 +16,7 @@ func TestHTTPRequestCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "http.request.do", Params: map[string]any{ "method": "GET", @@ -27,6 +28,10 @@ func TestHTTPRequestCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create http.request.do processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("http.request.do processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "http.request.do" { t.Fatalf("http.request.do processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/http-response-create_test.go b/internal/processor/test/http-response-create_test.go index 157fd89..7f8a09a 100644 --- a/internal/processor/test/http-response-create_test.go +++ b/internal/processor/test/http-response-create_test.go @@ -16,6 +16,7 @@ func TestHTTPResponseCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "http.response.create", Params: map[string]any{ "status": 200, @@ -27,6 +28,10 @@ func TestHTTPResponseCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create http.response.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("http.response.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "http.response.create" { t.Fatalf("http.response.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/int-parse_test.go b/internal/processor/test/int-parse_test.go index 9b64f54..4d9814c 100644 --- a/internal/processor/test/int-parse_test.go +++ b/internal/processor/test/int-parse_test.go @@ -16,6 +16,7 @@ func TestIntParseFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "int.parse", }) @@ -23,6 +24,10 @@ func TestIntParseFromRegistry(t *testing.T) { t.Fatalf("failed to create int.parse processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("int.parse processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "int.parse" { t.Fatalf("int.parse processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/int-random_test.go b/internal/processor/test/int-random_test.go index 2297541..8f90797 100644 --- a/internal/processor/test/int-random_test.go +++ b/internal/processor/test/int-random_test.go @@ -15,6 +15,7 @@ func TestIntRandomFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "int.random", Params: map[string]any{ "min": 1, @@ -26,6 +27,10 @@ func TestIntRandomFromRegistry(t *testing.T) { t.Fatalf("failed to create int.random processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("int.random processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "int.random" { t.Fatalf("int.random processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/int-scale_test.go b/internal/processor/test/int-scale_test.go index f4b57cd..095f7b3 100644 --- a/internal/processor/test/int-scale_test.go +++ b/internal/processor/test/int-scale_test.go @@ -15,6 +15,7 @@ func TestIntScaleFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "int.scale", Params: map[string]any{ "inMin": 0, @@ -28,6 +29,10 @@ func TestIntScaleFromRegistry(t *testing.T) { t.Fatalf("failed to create int.scale processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("int.scale processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "int.scale" { t.Fatalf("int.scale processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/json-decode_test.go b/internal/processor/test/json-decode_test.go index f355263..477f355 100644 --- a/internal/processor/test/json-decode_test.go +++ b/internal/processor/test/json-decode_test.go @@ -17,12 +17,17 @@ func TestJsonDecodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "json.decode", }) if err != nil { t.Fatalf("failed to create json.decode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("json.decode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "json.decode" { t.Fatalf("json.decode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/json-encode_test.go b/internal/processor/test/json-encode_test.go index f07eb71..6bf78b9 100644 --- a/internal/processor/test/json-encode_test.go +++ b/internal/processor/test/json-encode_test.go @@ -18,12 +18,17 @@ func TestJsonEncodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "json.encode", }) if err != nil { t.Fatalf("failed to create json.encode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("json.encode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "json.encode" { t.Fatalf("json.encode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/kv-get_test.go b/internal/processor/test/kv-get_test.go index 3b81698..d92a87e 100644 --- a/internal/processor/test/kv-get_test.go +++ b/internal/processor/test/kv-get_test.go @@ -17,6 +17,7 @@ func TestKvGetFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "kv.get", Params: map[string]any{ "module": "test", @@ -27,6 +28,10 @@ func TestKvGetFromRegistry(t *testing.T) { t.Fatalf("failed to create kv.get processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("kv.get processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "kv.get" { t.Fatalf("kv.get processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/kv-set_test.go b/internal/processor/test/kv-set_test.go index 51304ba..95228ca 100644 --- a/internal/processor/test/kv-set_test.go +++ b/internal/processor/test/kv-set_test.go @@ -17,6 +17,7 @@ func TestKvSetFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "kv.set", Params: map[string]any{ "module": "test", @@ -27,6 +28,9 @@ func TestKvSetFromRegistry(t *testing.T) { t.Fatalf("failed to create kv.set processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("kv.set processor has wrong id: %s", processorInstance.Id()) + } if processorInstance.Type() != "kv.set" { t.Fatalf("kv.set processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/midi-control_change-create_test.go b/internal/processor/test/midi-control_change-create_test.go index 13f414a..dd464ab 100644 --- a/internal/processor/test/midi-control_change-create_test.go +++ b/internal/processor/test/midi-control_change-create_test.go @@ -17,6 +17,7 @@ func TestMIDIControlChangeCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.control_change.create", Params: map[string]any{ "channel": "1", @@ -29,6 +30,10 @@ func TestMIDIControlChangeCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create midi.control_change.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.control_change.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "midi.control_change.create" { t.Fatalf("midi.control_change.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/midi-message-decode_test.go b/internal/processor/test/midi-message-decode_test.go index f45adba..18507e9 100644 --- a/internal/processor/test/midi-message-decode_test.go +++ b/internal/processor/test/midi-message-decode_test.go @@ -17,6 +17,7 @@ func TestMIDIMessageDecodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.message.decode", }) @@ -24,6 +25,10 @@ func TestMIDIMessageDecodeFromRegistry(t *testing.T) { t.Fatalf("failed to create midi.message.decode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.message.decode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "midi.message.decode" { t.Fatalf("midi.message.decode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/midi-message-encode_test.go b/internal/processor/test/midi-message-encode_test.go index 5dc3cc4..65424f8 100644 --- a/internal/processor/test/midi-message-encode_test.go +++ b/internal/processor/test/midi-message-encode_test.go @@ -17,6 +17,7 @@ func TestMIDIMessageEncodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.message.encode", }) @@ -24,6 +25,10 @@ func TestMIDIMessageEncodeFromRegistry(t *testing.T) { t.Fatalf("failed to create midi.message.encode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.message.encode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "midi.message.encode" { t.Fatalf("midi.message.encode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/midi-message-unpack_test.go b/internal/processor/test/midi-message-unpack_test.go index 536e6b5..8da3d81 100644 --- a/internal/processor/test/midi-message-unpack_test.go +++ b/internal/processor/test/midi-message-unpack_test.go @@ -17,6 +17,7 @@ func TestMIDIMessageUnpackFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.message.unpack", }) @@ -24,6 +25,9 @@ func TestMIDIMessageUnpackFromRegistry(t *testing.T) { t.Fatalf("failed to create midi.message.unpack processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.message.unpack processor has wrong id: %s", processorInstance.Id()) + } if processorInstance.Type() != "midi.message.unpack" { t.Fatalf("midi.message.unpack processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/midi-note_off-create_test.go b/internal/processor/test/midi-note_off-create_test.go index b0f0f56..2c43b6e 100644 --- a/internal/processor/test/midi-note_off-create_test.go +++ b/internal/processor/test/midi-note_off-create_test.go @@ -17,6 +17,7 @@ func TestMIDINoteOffCreteaFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.note_off.create", Params: map[string]any{ "channel": "1", @@ -28,6 +29,9 @@ func TestMIDINoteOffCreteaFromRegistry(t *testing.T) { if err != nil { t.Fatalf("failed to create midi.note_off.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.note_off.create processor has wrong id: %s", processorInstance.Id()) + } if processorInstance.Type() != "midi.note_off.create" { t.Fatalf("midi.note_off.create processor has wrong type: %s", processorInstance.Type()) diff --git a/internal/processor/test/midi-note_on-create_test.go b/internal/processor/test/midi-note_on-create_test.go index f7cc456..23f5cb5 100644 --- a/internal/processor/test/midi-note_on-create_test.go +++ b/internal/processor/test/midi-note_on-create_test.go @@ -17,6 +17,7 @@ func TestMIDINoteOnCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.note_on.create", Params: map[string]any{ "channel": "1", @@ -29,6 +30,10 @@ func TestMIDINoteOnCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create midi.note_on.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.note_on.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "midi.note_on.create" { t.Fatalf("midi.note_on.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/midi-program_change-create_test.go b/internal/processor/test/midi-program_change-create_test.go index b51ede1..51681c0 100644 --- a/internal/processor/test/midi-program_change-create_test.go +++ b/internal/processor/test/midi-program_change-create_test.go @@ -17,6 +17,7 @@ func TestMIDIProgramChangeCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "midi.program_change.create", Params: map[string]any{ "channel": "1", @@ -28,6 +29,10 @@ func TestMIDIProgramChangeCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create midi.program_change.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("midi.program_change.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "midi.program_change.create" { t.Fatalf("midi.program_change.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/module-output_test.go b/internal/processor/test/module-output_test.go index 28e25b5..2ab6807 100644 --- a/internal/processor/test/module-output_test.go +++ b/internal/processor/test/module-output_test.go @@ -17,6 +17,7 @@ func TestModuleOutputFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "module.output", Params: config.Params{ "module": "test", @@ -27,6 +28,10 @@ func TestModuleOutputFromRegistry(t *testing.T) { t.Fatalf("failed to create module.output processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("module.output processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "module.output" { t.Fatalf("module.output processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/osc-message-create_test.go b/internal/processor/test/osc-message-create_test.go index d35eda4..328e796 100644 --- a/internal/processor/test/osc-message-create_test.go +++ b/internal/processor/test/osc-message-create_test.go @@ -17,6 +17,7 @@ func TestOSCMessageCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "osc.message.create", Params: map[string]any{ "address": "/test", @@ -27,6 +28,10 @@ func TestOSCMessageCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create osc.message.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("osc.message.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "osc.message.create" { t.Fatalf("osc.message.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/osc-message-decode_test.go b/internal/processor/test/osc-message-decode_test.go index 61735b1..3abee8f 100644 --- a/internal/processor/test/osc-message-decode_test.go +++ b/internal/processor/test/osc-message-decode_test.go @@ -17,6 +17,7 @@ func TestOSCMessageDecodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "osc.message.decode", }) @@ -24,6 +25,10 @@ func TestOSCMessageDecodeFromRegistry(t *testing.T) { t.Fatalf("failed to create osc.message.decode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("osc.message.decode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "osc.message.decode" { t.Fatalf("osc.message.decode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/osc-message-encode_test.go b/internal/processor/test/osc-message-encode_test.go index 43cee77..c37373d 100644 --- a/internal/processor/test/osc-message-encode_test.go +++ b/internal/processor/test/osc-message-encode_test.go @@ -17,6 +17,7 @@ func TestOSCMessageEncodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "osc.message.encode", }) @@ -24,6 +25,10 @@ func TestOSCMessageEncodeFromRegistry(t *testing.T) { t.Fatalf("failed to create osc.message.encode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("osc.message.encode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "osc.message.encode" { t.Fatalf("osc.message.encode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/pubsub-publish_test.go b/internal/processor/test/pubsub-publish_test.go index 35c931e..af21df1 100644 --- a/internal/processor/test/pubsub-publish_test.go +++ b/internal/processor/test/pubsub-publish_test.go @@ -18,6 +18,7 @@ func TestPubSubPublishFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "pubsub.publish", Params: map[string]any{ "module": "test", @@ -28,6 +29,10 @@ func TestPubSubPublishFromRegistry(t *testing.T) { t.Fatalf("failed to create pubsub.publish processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("pubsub.publish processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "pubsub.publish" { t.Fatalf("pubsub.publish processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/router-input_test.go b/internal/processor/test/router-input_test.go index 28af28c..3698a18 100644 --- a/internal/processor/test/router-input_test.go +++ b/internal/processor/test/router-input_test.go @@ -17,6 +17,7 @@ func TestRouterInputFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "router.input", Params: config.Params{ "source": "test", @@ -27,6 +28,10 @@ func TestRouterInputFromRegistry(t *testing.T) { t.Fatalf("failed to create router.input processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("router.input processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "router.input" { t.Fatalf("router.input processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/script-expr_test.go b/internal/processor/test/script-expr_test.go index 76cbe3a..9a371c4 100644 --- a/internal/processor/test/script-expr_test.go +++ b/internal/processor/test/script-expr_test.go @@ -15,6 +15,7 @@ func TestScriptExprFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "script.expr", Params: map[string]any{ "expression": "foo + bar", @@ -24,6 +25,10 @@ func TestScriptExprFromRegistry(t *testing.T) { t.Fatalf("failed to create script.expr processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("script.expr processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "script.expr" { t.Fatalf("script.expr processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/script-js_test.go b/internal/processor/test/script-js_test.go index 3caedb0..b438358 100644 --- a/internal/processor/test/script-js_test.go +++ b/internal/processor/test/script-js_test.go @@ -16,6 +16,7 @@ func TestScriptJSFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "script.js", Params: map[string]any{ "program": ` @@ -27,6 +28,10 @@ func TestScriptJSFromRegistry(t *testing.T) { t.Fatalf("failed to create script.js processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("script.js processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "script.js" { t.Fatalf("script.js processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/script-wasm_test.go b/internal/processor/test/script-wasm_test.go index a43a423..83db4d3 100644 --- a/internal/processor/test/script-wasm_test.go +++ b/internal/processor/test/script-wasm_test.go @@ -17,6 +17,7 @@ func TestScriptWASMFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "script.wasm", Params: map[string]any{ "path": "good.wasm", @@ -26,6 +27,10 @@ func TestScriptWASMFromRegistry(t *testing.T) { t.Fatalf("failed to create script.wasm processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("script.wasm processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "script.wasm" { t.Fatalf("script.wasm processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/sip-response-audio-create_test.go b/internal/processor/test/sip-response-audio-create_test.go index 72af798..adafb82 100644 --- a/internal/processor/test/sip-response-audio-create_test.go +++ b/internal/processor/test/sip-response-audio-create_test.go @@ -16,6 +16,7 @@ func TestSipResponseAudioCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "sip.response.audio.create", Params: map[string]any{ "preWait": 0, @@ -28,6 +29,10 @@ func TestSipResponseAudioCreateFromRegistry(t *testing.T) { t.Fatalf("failed to filter sip.response.audio.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("sip.response.audio.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "sip.response.audio.create" { t.Fatalf("sip.response.audio.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/sip-response-dtmf-create_test.go b/internal/processor/test/sip-response-dtmf-create_test.go index 8a3d238..971fade 100644 --- a/internal/processor/test/sip-response-dtmf-create_test.go +++ b/internal/processor/test/sip-response-dtmf-create_test.go @@ -16,6 +16,7 @@ func TestSipResponseDTMFCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "sip.response.dtmf.create", Params: map[string]any{ "preWait": 0, @@ -28,6 +29,10 @@ func TestSipResponseDTMFCreateFromRegistry(t *testing.T) { t.Fatalf("failed to filter sip.response.dtmf.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("sip.response.dtmf.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "sip.response.dtmf.create" { t.Fatalf("sip.response.dtmf.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/string-create_test.go b/internal/processor/test/string-create_test.go index fc733d2..63a4880 100644 --- a/internal/processor/test/string-create_test.go +++ b/internal/processor/test/string-create_test.go @@ -16,6 +16,7 @@ func TestStringCreateFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "string.create", Params: map[string]any{ "template": "{{.Payload}}", @@ -25,6 +26,10 @@ func TestStringCreateFromRegistry(t *testing.T) { t.Fatalf("failed to create string.create processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("string.create processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "string.create" { t.Fatalf("string.create processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/string-decode_test.go b/internal/processor/test/string-decode_test.go index 7934752..b1b88e3 100644 --- a/internal/processor/test/string-decode_test.go +++ b/internal/processor/test/string-decode_test.go @@ -16,12 +16,17 @@ func TestStringDecodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "string.decode", }) if err != nil { t.Fatalf("failed to create string.decode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("string.decode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "string.decode" { t.Fatalf("string.decode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/string-encode_test.go b/internal/processor/test/string-encode_test.go index f00393a..d393611 100644 --- a/internal/processor/test/string-encode_test.go +++ b/internal/processor/test/string-encode_test.go @@ -17,12 +17,17 @@ func TestStringEncodeFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "string.encode", }) if err != nil { t.Fatalf("failed to create string.encode processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("string.encode processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "string.encode" { t.Fatalf("string.encode processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/string-split_test.go b/internal/processor/test/string-split_test.go index 3b980be..687902e 100644 --- a/internal/processor/test/string-split_test.go +++ b/internal/processor/test/string-split_test.go @@ -17,6 +17,7 @@ func TestStringSplitFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "string.split", Params: map[string]any{ "separator": ",", @@ -26,6 +27,10 @@ func TestStringSplitFromRegistry(t *testing.T) { t.Fatalf("failed to create string.split processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("string.split processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "string.split" { t.Fatalf("string.split processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/struct-field-get_test.go b/internal/processor/test/struct-field-get_test.go index 174e1bb..9c5e6c1 100644 --- a/internal/processor/test/struct-field-get_test.go +++ b/internal/processor/test/struct-field-get_test.go @@ -17,6 +17,7 @@ func TestStructFieldGetFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "struct.field.get", Params: map[string]any{ "name": "Data", @@ -26,6 +27,10 @@ func TestStructFieldGetFromRegistry(t *testing.T) { t.Fatalf("failed to create struct.field.get processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("struct.field.get processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "struct.field.get" { t.Fatalf("struct.field.get processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/struct-method-get_test.go b/internal/processor/test/struct-method-get_test.go index f1dbc91..e82f531 100644 --- a/internal/processor/test/struct-method-get_test.go +++ b/internal/processor/test/struct-method-get_test.go @@ -17,6 +17,7 @@ func TestStructMethodGetFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "struct.method.get", Params: map[string]any{ "name": "GetData", @@ -26,6 +27,10 @@ func TestStructMethodGetFromRegistry(t *testing.T) { t.Fatalf("failed to create struct.method.get processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("struct.method.get processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "struct.method.get" { t.Fatalf("struct.method.get processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/test/time-sleep_test.go b/internal/processor/test/time-sleep_test.go index 55e1267..e93bde4 100644 --- a/internal/processor/test/time-sleep_test.go +++ b/internal/processor/test/time-sleep_test.go @@ -15,6 +15,7 @@ func TestTimeSleepFromRegistry(t *testing.T) { } processorInstance, err := registration.New(config.ProcessorConfig{ + Id: "test-id", Type: "time.sleep", Params: map[string]any{ "duration": 1000, @@ -25,6 +26,10 @@ func TestTimeSleepFromRegistry(t *testing.T) { t.Fatalf("failed to create time.sleep processor: %s", err) } + if processorInstance.Id() != "test-id" { + t.Fatalf("time.sleep processor has wrong id: %s", processorInstance.Id()) + } + if processorInstance.Type() != "time.sleep" { t.Fatalf("time.sleep processor has wrong type: %s", processorInstance.Type()) } diff --git a/internal/processor/time-sleep.go b/internal/processor/time-sleep.go index 0165270..e6612fd 100644 --- a/internal/processor/time-sleep.go +++ b/internal/processor/time-sleep.go @@ -49,6 +49,10 @@ func (ts *TimeSleep) Process(ctx context.Context, wrappedPayload common.WrappedP return wrappedPayload, nil } +func (ts *TimeSleep) Id() string { + return ts.config.Id +} + func (ts *TimeSleep) Type() string { return ts.config.Type } diff --git a/internal/test/processor.go b/internal/test/processor.go index 69aa146..f017020 100644 --- a/internal/test/processor.go +++ b/internal/test/processor.go @@ -9,6 +9,10 @@ import ( type TestProcessor struct { } +func (p *TestProcessor) Id() string { + return "test-id" +} + func (p *TestProcessor) Type() string { return "test" }