mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-09-10 07:29:25 +00:00
Merge pull request #233 from jwetzell/processor-id
add id getter for processors
This commit is contained in:
@@ -44,6 +44,10 @@ func (apd *ArtNetPacketDecode) Process(ctx context.Context, wrappedPayload commo
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (apd *ArtNetPacketDecode) Id() string {
|
||||||
|
return apd.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (apd *ArtNetPacketDecode) Type() string {
|
func (apd *ArtNetPacketDecode) Type() string {
|
||||||
return apd.config.Type
|
return apd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ func (ape *ArtNetPacketEncode) Process(ctx context.Context, wrappedPayload commo
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ape *ArtNetPacketEncode) Id() string {
|
||||||
|
return ape.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ape *ArtNetPacketEncode) Type() string {
|
func (ape *ArtNetPacketEncode) Type() string {
|
||||||
return ape.config.Type
|
return ape.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,10 @@ func (dq *DbQuery) Process(ctx context.Context, wrappedPayload common.WrappedPay
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (dq *DbQuery) Id() string {
|
||||||
|
return dq.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (dq *DbQuery) Type() string {
|
func (dq *DbQuery) Type() string {
|
||||||
return dq.config.Type
|
return dq.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ func (dl *DebugLog) Process(ctx context.Context, wrappedPayload common.WrappedPa
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (dl *DebugLog) Id() string {
|
||||||
|
return dl.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (dl *DebugLog) Type() string {
|
func (dl *DebugLog) Type() string {
|
||||||
return dl.config.Type
|
return dl.config.Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ func (fc *FilterChange) Process(ctx context.Context, wrappedPayload common.Wrapp
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fc *FilterChange) Id() string {
|
||||||
|
return fc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fc *FilterChange) Type() string {
|
func (fc *FilterChange) Type() string {
|
||||||
return fc.config.Type
|
return fc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,10 @@ func (fe *FilterExpr) Process(ctx context.Context, wrappedPayload common.Wrapped
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fe *FilterExpr) Id() string {
|
||||||
|
return fe.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fe *FilterExpr) Type() string {
|
func (fe *FilterExpr) Type() string {
|
||||||
return fe.config.Type
|
return fe.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ func (fc *FilterRate) Process(ctx context.Context, wrappedPayload common.Wrapped
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fc *FilterRate) Id() string {
|
||||||
|
return fc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fc *FilterRate) Type() string {
|
func (fc *FilterRate) Type() string {
|
||||||
return fc.config.Type
|
return fc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,10 @@ func (fr *FilterRegex) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fr *FilterRegex) Id() string {
|
||||||
|
return fr.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fr *FilterRegex) Type() string {
|
func (fr *FilterRegex) Type() string {
|
||||||
return fr.config.Type
|
return fr.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ func (fp *FloatParse) Process(ctx context.Context, wrappedPayload common.Wrapped
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fp *FloatParse) Id() string {
|
||||||
|
return fp.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fp *FloatParse) Type() string {
|
func (fp *FloatParse) Type() string {
|
||||||
return fp.config.Type
|
return fp.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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")
|
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 {
|
func (fr *FloatRandom) Type() string {
|
||||||
return fr.config.Type
|
return fr.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,32 +182,32 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &FreeDCreate{
|
return &FreeDCreate{
|
||||||
config: config,
|
config: config,
|
||||||
Id: idTemplate,
|
IdTemplate: idTemplate,
|
||||||
Pan: panTemplate,
|
PanTemplate: panTemplate,
|
||||||
Tilt: tiltTemplate,
|
TiltTemplate: tiltTemplate,
|
||||||
Roll: rollTemplate,
|
RollTemplate: rollTemplate,
|
||||||
PosX: posXTemplate,
|
PosXTemplate: posXTemplate,
|
||||||
PosY: posYTemplate,
|
PosYTemplate: posYTemplate,
|
||||||
PosZ: posZTemplate,
|
PosZTemplate: posZTemplate,
|
||||||
Zoom: zoomTemplate,
|
ZoomTemplate: zoomTemplate,
|
||||||
Focus: focusTemplate,
|
FocusTemplate: focusTemplate,
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
type FreeDCreate struct {
|
type FreeDCreate struct {
|
||||||
config config.ProcessorConfig
|
config config.ProcessorConfig
|
||||||
Id *template.Template
|
IdTemplate *template.Template
|
||||||
Pan *template.Template
|
PanTemplate *template.Template
|
||||||
Tilt *template.Template
|
TiltTemplate *template.Template
|
||||||
Roll *template.Template
|
RollTemplate *template.Template
|
||||||
PosX *template.Template
|
PosXTemplate *template.Template
|
||||||
PosY *template.Template
|
PosYTemplate *template.Template
|
||||||
PosZ *template.Template
|
PosZTemplate *template.Template
|
||||||
Zoom *template.Template
|
ZoomTemplate *template.Template
|
||||||
Focus *template.Template
|
FocusTemplate *template.Template
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
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
|
templateData := wrappedPayload
|
||||||
|
|
||||||
var idBuffer bytes.Buffer
|
var idBuffer bytes.Buffer
|
||||||
err := fc.Id.Execute(&idBuffer, templateData)
|
err := fc.IdTemplate.Execute(&idBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -232,7 +232,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var panBuffer bytes.Buffer
|
var panBuffer bytes.Buffer
|
||||||
err = fc.Pan.Execute(&panBuffer, templateData)
|
err = fc.PanTemplate.Execute(&panBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -249,7 +249,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var tiltBuffer bytes.Buffer
|
var tiltBuffer bytes.Buffer
|
||||||
err = fc.Tilt.Execute(&tiltBuffer, templateData)
|
err = fc.TiltTemplate.Execute(&tiltBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -266,7 +266,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var rollBuffer bytes.Buffer
|
var rollBuffer bytes.Buffer
|
||||||
err = fc.Roll.Execute(&rollBuffer, templateData)
|
err = fc.RollTemplate.Execute(&rollBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -283,7 +283,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var posXBuffer bytes.Buffer
|
var posXBuffer bytes.Buffer
|
||||||
err = fc.PosX.Execute(&posXBuffer, templateData)
|
err = fc.PosXTemplate.Execute(&posXBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -300,7 +300,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var posYBuffer bytes.Buffer
|
var posYBuffer bytes.Buffer
|
||||||
err = fc.PosY.Execute(&posYBuffer, templateData)
|
err = fc.PosYTemplate.Execute(&posYBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -317,7 +317,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var posZBuffer bytes.Buffer
|
var posZBuffer bytes.Buffer
|
||||||
err = fc.PosZ.Execute(&posZBuffer, templateData)
|
err = fc.PosZTemplate.Execute(&posZBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -334,7 +334,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var zoomBuffer bytes.Buffer
|
var zoomBuffer bytes.Buffer
|
||||||
err = fc.Zoom.Execute(&zoomBuffer, templateData)
|
err = fc.ZoomTemplate.Execute(&zoomBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -351,7 +351,7 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
var focusBuffer bytes.Buffer
|
var focusBuffer bytes.Buffer
|
||||||
err = fc.Focus.Execute(&focusBuffer, templateData)
|
err = fc.FocusTemplate.Execute(&focusBuffer, templateData)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wrappedPayload.End = true
|
wrappedPayload.End = true
|
||||||
@@ -384,6 +384,10 @@ func (fc *FreeDCreate) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fc *FreeDCreate) Id() string {
|
||||||
|
return fc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fc *FreeDCreate) Type() string {
|
func (fc *FreeDCreate) Type() string {
|
||||||
return fc.config.Type
|
return fc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ func init() {
|
|||||||
|
|
||||||
type FreeDDecode struct {
|
type FreeDDecode struct {
|
||||||
config config.ProcessorConfig
|
config config.ProcessorConfig
|
||||||
buf [29]byte
|
buf [29]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
||||||
payload := wrappedPayload.Payload
|
payload := wrappedPayload.Payload
|
||||||
payloadBytes, ok := common.GetAnyAsByteSlice(payload)
|
payloadBytes, ok := common.GetAnyAsByteSlice(payload)
|
||||||
@@ -49,6 +49,10 @@ func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fd *FreeDDecode) Id() string {
|
||||||
|
return fd.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fd *FreeDDecode) Type() string {
|
func (fd *FreeDDecode) Type() string {
|
||||||
return fd.config.Type
|
return fd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ func (fe *FreeDEncode) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fe *FreeDEncode) Id() string {
|
||||||
|
return fe.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (fe *FreeDEncode) Type() string {
|
func (fe *FreeDEncode) Type() string {
|
||||||
return fe.config.Type
|
return fe.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,10 @@ func (hrd *HTTPRequestDo) Process(ctx context.Context, wrappedPayload common.Wra
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (hrd *HTTPRequestDo) Id() string {
|
||||||
|
return hrd.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (hrd *HTTPRequestDo) Type() string {
|
func (hrd *HTTPRequestDo) Type() string {
|
||||||
return hrd.config.Type
|
return hrd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ func (hrc *HTTPResponseCreate) Process(ctx context.Context, wrappedPayload commo
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (hrc *HTTPResponseCreate) Id() string {
|
||||||
|
return hrc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (hrc *HTTPResponseCreate) Type() string {
|
func (hrc *HTTPResponseCreate) Type() string {
|
||||||
return hrc.config.Type
|
return hrc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ func (ip *IntParse) Process(ctx context.Context, wrappedPayload common.WrappedPa
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ip *IntParse) Id() string {
|
||||||
|
return ip.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ip *IntParse) Type() string {
|
func (ip *IntParse) Type() string {
|
||||||
return ip.config.Type
|
return ip.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ func (ir *IntRandom) Process(ctx context.Context, wrappedPayload common.WrappedP
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ir *IntRandom) Id() string {
|
||||||
|
return ir.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ir *IntRandom) Type() string {
|
func (ir *IntRandom) Type() string {
|
||||||
return ir.config.Type
|
return ir.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,10 @@ func (is *IntScale) Process(ctx context.Context, wrappedPayload common.WrappedPa
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (is *IntScale) Id() string {
|
||||||
|
return is.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (is *IntScale) Type() string {
|
func (is *IntScale) Type() string {
|
||||||
return is.config.Type
|
return is.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
func (jd *JsonDecode) Type() string {
|
||||||
return jd.config.Type
|
return jd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ func (je *JsonEncode) Process(ctx context.Context, wrappedPayload common.Wrapped
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (je *JsonEncode) Id() string {
|
||||||
|
return je.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (je *JsonEncode) Type() string {
|
func (je *JsonEncode) Type() string {
|
||||||
return je.config.Type
|
return je.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ func (kvg *KVGet) Process(ctx context.Context, wrappedPayload common.WrappedPayl
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (kvg *KVGet) Id() string {
|
||||||
|
return kvg.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (kvg *KVGet) Type() string {
|
func (kvg *KVGet) Type() string {
|
||||||
return kvg.config.Type
|
return kvg.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ func (kvs *KVSet) Process(ctx context.Context, wrappedPayload common.WrappedPayl
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (kvs *KVSet) Id() string {
|
||||||
|
return kvs.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (kvs *KVSet) Type() string {
|
func (kvs *KVSet) Type() string {
|
||||||
return kvs.config.Type
|
return kvs.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ func (mccc *MIDIControlChangeCreate) Process(ctx context.Context, wrappedPayload
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mccc *MIDIControlChangeCreate) Id() string {
|
||||||
|
return mccc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mccc *MIDIControlChangeCreate) Type() string {
|
func (mccc *MIDIControlChangeCreate) Type() string {
|
||||||
return mccc.config.Type
|
return mccc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ func (mmd *MIDIMessageDecode) Process(ctx context.Context, wrappedPayload common
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mmd *MIDIMessageDecode) Id() string {
|
||||||
|
return mmd.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mmd *MIDIMessageDecode) Type() string {
|
func (mmd *MIDIMessageDecode) Type() string {
|
||||||
return mmd.config.Type
|
return mmd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ func (mme *MIDIMessageEncode) Process(ctx context.Context, wrappedPayload common
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mme *MIDIMessageEncode) Id() string {
|
||||||
|
return mme.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mme *MIDIMessageEncode) Type() string {
|
func (mme *MIDIMessageEncode) Type() string {
|
||||||
return mme.config.Type
|
return mme.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {
|
func (mmu *MIDIMessageUnpack) Type() string {
|
||||||
return mmu.config.Type
|
return mmu.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,10 @@ func (mnoc *MIDINoteOffCreate) Process(ctx context.Context, wrappedPayload commo
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mnoc *MIDINoteOffCreate) Id() string {
|
||||||
|
return mnoc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mnoc *MIDINoteOffCreate) Type() string {
|
func (mnoc *MIDINoteOffCreate) Type() string {
|
||||||
return mnoc.config.Type
|
return mnoc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ func (mnoc *MIDINoteOnCreate) Process(ctx context.Context, wrappedPayload common
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mnoc *MIDINoteOnCreate) Id() string {
|
||||||
|
return mnoc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mnoc *MIDINoteOnCreate) Type() string {
|
func (mnoc *MIDINoteOnCreate) Type() string {
|
||||||
return mnoc.config.Type
|
return mnoc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ func (mpcc *MIDIProgramChangeCreate) Process(ctx context.Context, wrappedPayload
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mpcc *MIDIProgramChangeCreate) Id() string {
|
||||||
|
return mpcc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mpcc *MIDIProgramChangeCreate) Type() string {
|
func (mpcc *MIDIProgramChangeCreate) Type() string {
|
||||||
return mpcc.config.Type
|
return mpcc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ func (mo *ModuleOutput) Process(ctx context.Context, wrappedPayload common.Wrapp
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (mo *ModuleOutput) Id() string {
|
||||||
|
return mo.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (mo *ModuleOutput) Type() string {
|
func (mo *ModuleOutput) Type() string {
|
||||||
return mo.config.Type
|
return mo.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,10 @@ func (omc *OSCMessageCreate) Process(ctx context.Context, wrappedPayload common.
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (omc *OSCMessageCreate) Id() string {
|
||||||
|
return omc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (omc *OSCMessageCreate) Type() string {
|
func (omc *OSCMessageCreate) Type() string {
|
||||||
return omc.config.Type
|
return omc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ func (omd *OSCMessageDecode) Process(ctx context.Context, wrappedPayload common.
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (omd *OSCMessageDecode) Id() string {
|
||||||
|
return omd.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (omd *OSCMessageDecode) Type() string {
|
func (omd *OSCMessageDecode) Type() string {
|
||||||
return omd.config.Type
|
return omd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ func (ome *OSCMessageEncode) Process(ctx context.Context, wrappedPayload common.
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ome *OSCMessageEncode) Id() string {
|
||||||
|
return ome.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ome *OSCMessageEncode) Type() string {
|
func (ome *OSCMessageEncode) Type() string {
|
||||||
return ome.config.Type
|
return ome.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Processor interface {
|
type Processor interface {
|
||||||
|
Id() string
|
||||||
Type() string
|
Type() string
|
||||||
Process(context.Context, common.WrappedPayload) (common.WrappedPayload, error)
|
Process(context.Context, common.WrappedPayload) (common.WrappedPayload, error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,6 +104,10 @@ func (psp *PubSubPublish) Process(ctx context.Context, wrappedPayload common.Wra
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (psp *PubSubPublish) Id() string {
|
||||||
|
return psp.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (psp *PubSubPublish) Type() string {
|
func (psp *PubSubPublish) Type() string {
|
||||||
return psp.config.Type
|
return psp.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ func (ri *RouterInput) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ri *RouterInput) Id() string {
|
||||||
|
return ri.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ri *RouterInput) Type() string {
|
func (ri *RouterInput) Type() string {
|
||||||
return ri.config.Type
|
return ri.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ func (se *ScriptExpr) Process(ctx context.Context, wrappedPayload common.Wrapped
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (se *ScriptExpr) Id() string {
|
||||||
|
return se.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (se *ScriptExpr) Type() string {
|
func (se *ScriptExpr) Type() string {
|
||||||
return se.config.Type
|
return se.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ func (sj *ScriptJS) Process(ctx context.Context, wrappedPayload common.WrappedPa
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sj *ScriptJS) Id() string {
|
||||||
|
return sj.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (sj *ScriptJS) Type() string {
|
func (sj *ScriptJS) Type() string {
|
||||||
return sj.config.Type
|
return sj.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,10 @@ func (sw *ScriptWASM) Process(ctx context.Context, wrappedPayload common.Wrapped
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sw *ScriptWASM) Id() string {
|
||||||
|
return sw.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (sw *ScriptWASM) Type() string {
|
func (sw *ScriptWASM) Type() string {
|
||||||
return sw.config.Type
|
return sw.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ func (srac *SipResponseAudioCreate) Process(ctx context.Context, wrappedPayload
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (srac *SipResponseAudioCreate) Id() string {
|
||||||
|
return srac.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (srac *SipResponseAudioCreate) Type() string {
|
func (srac *SipResponseAudioCreate) Type() string {
|
||||||
return srac.config.Type
|
return srac.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ func (srdc *SipResponseDTMFCreate) Process(ctx context.Context, wrappedPayload c
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (srdc *SipResponseDTMFCreate) Id() string {
|
||||||
|
return srdc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (srdc *SipResponseDTMFCreate) Type() string {
|
func (srdc *SipResponseDTMFCreate) Type() string {
|
||||||
return srdc.config.Type
|
return srdc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ func (sc *StringCreate) Process(ctx context.Context, wrappedPayload common.Wrapp
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sc *StringCreate) Id() string {
|
||||||
|
return sc.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (sc *StringCreate) Type() string {
|
func (sc *StringCreate) Type() string {
|
||||||
return sc.config.Type
|
return sc.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ func (sd *StringDecode) Process(ctx context.Context, wrappedPayload common.Wrapp
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sd *StringDecode) Id() string {
|
||||||
|
return sd.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (sd *StringDecode) Type() string {
|
func (sd *StringDecode) Type() string {
|
||||||
return sd.config.Type
|
return sd.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ func (se *StringEncode) Process(ctx context.Context, wrappedPayload common.Wrapp
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (se *StringEncode) Id() string {
|
||||||
|
return se.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (se *StringEncode) Type() string {
|
func (se *StringEncode) Type() string {
|
||||||
return se.config.Type
|
return se.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ func (ss *StringSplit) Process(ctx context.Context, wrappedPayload common.Wrappe
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ss *StringSplit) Id() string {
|
||||||
|
return ss.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ss *StringSplit) Type() string {
|
func (ss *StringSplit) Type() string {
|
||||||
return ss.config.Type
|
return ss.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,10 @@ func (sfg *StructFieldGet) Process(ctx context.Context, wrappedPayload common.Wr
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sfg *StructFieldGet) Id() string {
|
||||||
|
return sfg.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (sfg *StructFieldGet) Type() string {
|
func (sfg *StructFieldGet) Type() string {
|
||||||
return sfg.config.Type
|
return sfg.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ func (smg *StructMethodGet) Process(ctx context.Context, wrappedPayload common.W
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (smg *StructMethodGet) Id() string {
|
||||||
|
return smg.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (smg *StructMethodGet) Type() string {
|
func (smg *StructMethodGet) Type() string {
|
||||||
return smg.config.Type
|
return smg.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestArtnetPacketDecodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "artnet.packet.decode",
|
Type: "artnet.packet.decode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestArtnetPacketDecodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create artnet.packet.decode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "artnet.packet.decode" {
|
||||||
t.Fatalf("artnet.packet.decode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("artnet.packet.decode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestArtnetPacketEncodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "artnet.packet.encode",
|
Type: "artnet.packet.encode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestArtnetPacketEncodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create artnet.packet.encode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "artnet.packet.encode" {
|
||||||
t.Fatalf("artnet.packet.encode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("artnet.packet.encode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ func TestDbQueryFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "db.query",
|
Type: "db.query",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"module": "test",
|
"module": "test",
|
||||||
@@ -28,6 +29,10 @@ func TestDbQueryFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create db.query processor: %s", err)
|
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" {
|
if processorInstance.Type() != "db.query" {
|
||||||
t.Fatalf("db.query processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("db.query processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestDebugLogFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "debug.log",
|
Type: "debug.log",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -23,6 +24,10 @@ func TestDebugLogFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create debug.log processor: %s", err)
|
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" {
|
if processorInstance.Type() != "debug.log" {
|
||||||
t.Fatalf("debug.log processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("debug.log processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,17 @@ func TestFilterChangeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "filter.change",
|
Type: "filter.change",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create filter.change processor: %s", err)
|
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" {
|
if processorInstance.Type() != "filter.change" {
|
||||||
t.Fatalf("filter.change processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("filter.change processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestFilterExprFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "filter.expr",
|
Type: "filter.expr",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"expression": "foo + bar",
|
"expression": "foo + bar",
|
||||||
@@ -25,6 +26,10 @@ func TestFilterExprFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create filter.expr processor: %s", err)
|
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" {
|
if processorInstance.Type() != "filter.expr" {
|
||||||
t.Fatalf("filter.expr processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("filter.expr processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestFilterRateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "filter.rate",
|
Type: "filter.rate",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"rate": 1,
|
"rate": 1,
|
||||||
@@ -25,6 +26,10 @@ func TestFilterRateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create filter.rate processor: %s", err)
|
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" {
|
if processorInstance.Type() != "filter.rate" {
|
||||||
t.Fatalf("filter.rate processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("filter.rate processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestFilterRegexFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "filter.regex",
|
Type: "filter.regex",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"pattern": "hello",
|
"pattern": "hello",
|
||||||
@@ -25,6 +26,10 @@ func TestFilterRegexFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create filter.regex processor: %s", err)
|
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" {
|
if processorInstance.Type() != "filter.regex" {
|
||||||
t.Fatalf("filter.regex processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("filter.regex processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestFloatParseFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "float.parse",
|
Type: "float.parse",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -23,6 +24,9 @@ func TestFloatParseFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create float.parse processor: %s", err)
|
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" {
|
if processorInstance.Type() != "float.parse" {
|
||||||
t.Fatalf("float.parse processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("float.parse processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func TestFloatRandomFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "float.random",
|
Type: "float.random",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"min": 1.0,
|
"min": 1.0,
|
||||||
@@ -26,6 +27,10 @@ func TestFloatRandomFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create float.random processor: %s", err)
|
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" {
|
if processorInstance.Type() != "float.random" {
|
||||||
t.Fatalf("float.random processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("float.random processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestFreeDCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "freed.create",
|
Type: "freed.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"id": "0",
|
"id": "0",
|
||||||
@@ -35,6 +36,10 @@ func TestFreeDCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create freed.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "freed.create" {
|
||||||
t.Fatalf("freed.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("freed.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestFreeDDecodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "freed.decode",
|
Type: "freed.decode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestFreeDDecodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create freed.decode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "freed.decode" {
|
||||||
t.Fatalf("freed.decode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("freed.decode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestFreeDEncodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "freed.encode",
|
Type: "freed.encode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestFreeDEncodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create freed.encode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "freed.encode" {
|
||||||
t.Fatalf("freed.encode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("freed.encode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestHTTPRequestCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "http.request.do",
|
Type: "http.request.do",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
@@ -27,6 +28,10 @@ func TestHTTPRequestCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create http.request.do processor: %s", err)
|
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" {
|
if processorInstance.Type() != "http.request.do" {
|
||||||
t.Fatalf("http.request.do processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("http.request.do processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestHTTPResponseCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "http.response.create",
|
Type: "http.response.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"status": 200,
|
"status": 200,
|
||||||
@@ -27,6 +28,10 @@ func TestHTTPResponseCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create http.response.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "http.response.create" {
|
||||||
t.Fatalf("http.response.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("http.response.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestIntParseFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "int.parse",
|
Type: "int.parse",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -23,6 +24,10 @@ func TestIntParseFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create int.parse processor: %s", err)
|
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" {
|
if processorInstance.Type() != "int.parse" {
|
||||||
t.Fatalf("int.parse processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("int.parse processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func TestIntRandomFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "int.random",
|
Type: "int.random",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"min": 1,
|
"min": 1,
|
||||||
@@ -26,6 +27,10 @@ func TestIntRandomFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create int.random processor: %s", err)
|
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" {
|
if processorInstance.Type() != "int.random" {
|
||||||
t.Fatalf("int.random processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("int.random processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func TestIntScaleFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "int.scale",
|
Type: "int.scale",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"inMin": 0,
|
"inMin": 0,
|
||||||
@@ -28,6 +29,10 @@ func TestIntScaleFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create int.scale processor: %s", err)
|
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" {
|
if processorInstance.Type() != "int.scale" {
|
||||||
t.Fatalf("int.scale processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("int.scale processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,17 @@ func TestJsonDecodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "json.decode",
|
Type: "json.decode",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create json.decode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "json.decode" {
|
||||||
t.Fatalf("json.decode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("json.decode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,17 @@ func TestJsonEncodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "json.encode",
|
Type: "json.encode",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create json.encode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "json.encode" {
|
||||||
t.Fatalf("json.encode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("json.encode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestKvGetFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "kv.get",
|
Type: "kv.get",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"module": "test",
|
"module": "test",
|
||||||
@@ -27,6 +28,10 @@ func TestKvGetFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create kv.get processor: %s", err)
|
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" {
|
if processorInstance.Type() != "kv.get" {
|
||||||
t.Fatalf("kv.get processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("kv.get processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestKvSetFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "kv.set",
|
Type: "kv.set",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"module": "test",
|
"module": "test",
|
||||||
@@ -27,6 +28,9 @@ func TestKvSetFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create kv.set processor: %s", err)
|
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" {
|
if processorInstance.Type() != "kv.set" {
|
||||||
t.Fatalf("kv.set processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("kv.set processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDIControlChangeCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.control_change.create",
|
Type: "midi.control_change.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"channel": "1",
|
"channel": "1",
|
||||||
@@ -29,6 +30,10 @@ func TestMIDIControlChangeCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create midi.control_change.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.control_change.create" {
|
||||||
t.Fatalf("midi.control_change.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.control_change.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDIMessageDecodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.message.decode",
|
Type: "midi.message.decode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestMIDIMessageDecodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create midi.message.decode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.message.decode" {
|
||||||
t.Fatalf("midi.message.decode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.message.decode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDIMessageEncodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.message.encode",
|
Type: "midi.message.encode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestMIDIMessageEncodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create midi.message.encode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.message.encode" {
|
||||||
t.Fatalf("midi.message.encode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.message.encode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDIMessageUnpackFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.message.unpack",
|
Type: "midi.message.unpack",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,9 @@ func TestMIDIMessageUnpackFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create midi.message.unpack processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.message.unpack" {
|
||||||
t.Fatalf("midi.message.unpack processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.message.unpack processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDINoteOffCreteaFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.note_off.create",
|
Type: "midi.note_off.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"channel": "1",
|
"channel": "1",
|
||||||
@@ -28,6 +29,9 @@ func TestMIDINoteOffCreteaFromRegistry(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create midi.note_off.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.note_off.create" {
|
||||||
t.Fatalf("midi.note_off.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.note_off.create processor has wrong type: %s", processorInstance.Type())
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDINoteOnCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.note_on.create",
|
Type: "midi.note_on.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"channel": "1",
|
"channel": "1",
|
||||||
@@ -29,6 +30,10 @@ func TestMIDINoteOnCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create midi.note_on.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.note_on.create" {
|
||||||
t.Fatalf("midi.note_on.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.note_on.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestMIDIProgramChangeCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "midi.program_change.create",
|
Type: "midi.program_change.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"channel": "1",
|
"channel": "1",
|
||||||
@@ -28,6 +29,10 @@ func TestMIDIProgramChangeCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create midi.program_change.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "midi.program_change.create" {
|
||||||
t.Fatalf("midi.program_change.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("midi.program_change.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestModuleOutputFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "module.output",
|
Type: "module.output",
|
||||||
Params: config.Params{
|
Params: config.Params{
|
||||||
"module": "test",
|
"module": "test",
|
||||||
@@ -27,6 +28,10 @@ func TestModuleOutputFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create module.output processor: %s", err)
|
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" {
|
if processorInstance.Type() != "module.output" {
|
||||||
t.Fatalf("module.output processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("module.output processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestOSCMessageCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "osc.message.create",
|
Type: "osc.message.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"address": "/test",
|
"address": "/test",
|
||||||
@@ -27,6 +28,10 @@ func TestOSCMessageCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create osc.message.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "osc.message.create" {
|
||||||
t.Fatalf("osc.message.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("osc.message.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestOSCMessageDecodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "osc.message.decode",
|
Type: "osc.message.decode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestOSCMessageDecodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create osc.message.decode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "osc.message.decode" {
|
||||||
t.Fatalf("osc.message.decode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("osc.message.decode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestOSCMessageEncodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "osc.message.encode",
|
Type: "osc.message.encode",
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -24,6 +25,10 @@ func TestOSCMessageEncodeFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create osc.message.encode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "osc.message.encode" {
|
||||||
t.Fatalf("osc.message.encode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("osc.message.encode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,3 +53,20 @@ func TestProcessorBadRegistrationExistingType(t *testing.T) {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTestProcessor(t *testing.T) {
|
||||||
|
testProcessor := &test.TestProcessor{
|
||||||
|
Config: config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
|
Type: "test",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if testProcessor.Id() != "test-id" {
|
||||||
|
t.Fatalf("test processor has wrong id: %s", testProcessor.Id())
|
||||||
|
}
|
||||||
|
|
||||||
|
if testProcessor.Type() != "test" {
|
||||||
|
t.Fatalf("test processor has wrong type: %s", testProcessor.Type())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ func TestPubSubPublishFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "pubsub.publish",
|
Type: "pubsub.publish",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"module": "test",
|
"module": "test",
|
||||||
@@ -28,6 +29,10 @@ func TestPubSubPublishFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create pubsub.publish processor: %s", err)
|
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" {
|
if processorInstance.Type() != "pubsub.publish" {
|
||||||
t.Fatalf("pubsub.publish processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("pubsub.publish processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestRouterInputFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "router.input",
|
Type: "router.input",
|
||||||
Params: config.Params{
|
Params: config.Params{
|
||||||
"source": "test",
|
"source": "test",
|
||||||
@@ -27,6 +28,10 @@ func TestRouterInputFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create router.input processor: %s", err)
|
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" {
|
if processorInstance.Type() != "router.input" {
|
||||||
t.Fatalf("router.input processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("router.input processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func TestScriptExprFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "script.expr",
|
Type: "script.expr",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"expression": "foo + bar",
|
"expression": "foo + bar",
|
||||||
@@ -24,6 +25,10 @@ func TestScriptExprFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create script.expr processor: %s", err)
|
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" {
|
if processorInstance.Type() != "script.expr" {
|
||||||
t.Fatalf("script.expr processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("script.expr processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestScriptJSFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "script.js",
|
Type: "script.js",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"program": `
|
"program": `
|
||||||
@@ -27,6 +28,10 @@ func TestScriptJSFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create script.js processor: %s", err)
|
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" {
|
if processorInstance.Type() != "script.js" {
|
||||||
t.Fatalf("script.js processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("script.js processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestScriptWASMFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "script.wasm",
|
Type: "script.wasm",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"path": "good.wasm",
|
"path": "good.wasm",
|
||||||
@@ -26,6 +27,10 @@ func TestScriptWASMFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create script.wasm processor: %s", err)
|
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" {
|
if processorInstance.Type() != "script.wasm" {
|
||||||
t.Fatalf("script.wasm processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("script.wasm processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestSipResponseAudioCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "sip.response.audio.create",
|
Type: "sip.response.audio.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"preWait": 0,
|
"preWait": 0,
|
||||||
@@ -28,6 +29,10 @@ func TestSipResponseAudioCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to filter sip.response.audio.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "sip.response.audio.create" {
|
||||||
t.Fatalf("sip.response.audio.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("sip.response.audio.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestSipResponseDTMFCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "sip.response.dtmf.create",
|
Type: "sip.response.dtmf.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"preWait": 0,
|
"preWait": 0,
|
||||||
@@ -28,6 +29,10 @@ func TestSipResponseDTMFCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to filter sip.response.dtmf.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "sip.response.dtmf.create" {
|
||||||
t.Fatalf("sip.response.dtmf.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("sip.response.dtmf.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestStringCreateFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "string.create",
|
Type: "string.create",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"template": "{{.Payload}}",
|
"template": "{{.Payload}}",
|
||||||
@@ -25,6 +26,10 @@ func TestStringCreateFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create string.create processor: %s", err)
|
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" {
|
if processorInstance.Type() != "string.create" {
|
||||||
t.Fatalf("string.create processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("string.create processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,17 @@ func TestStringDecodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "string.decode",
|
Type: "string.decode",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create string.decode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "string.decode" {
|
||||||
t.Fatalf("string.decode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("string.decode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,17 @@ func TestStringEncodeFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "string.encode",
|
Type: "string.encode",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create string.encode processor: %s", err)
|
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" {
|
if processorInstance.Type() != "string.encode" {
|
||||||
t.Fatalf("string.encode processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("string.encode processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestStringSplitFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "string.split",
|
Type: "string.split",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"separator": ",",
|
"separator": ",",
|
||||||
@@ -26,6 +27,10 @@ func TestStringSplitFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create string.split processor: %s", err)
|
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" {
|
if processorInstance.Type() != "string.split" {
|
||||||
t.Fatalf("string.split processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("string.split processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestStructFieldGetFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "struct.field.get",
|
Type: "struct.field.get",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"name": "Data",
|
"name": "Data",
|
||||||
@@ -26,6 +27,10 @@ func TestStructFieldGetFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create struct.field.get processor: %s", err)
|
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" {
|
if processorInstance.Type() != "struct.field.get" {
|
||||||
t.Fatalf("struct.field.get processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("struct.field.get processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestStructMethodGetFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "struct.method.get",
|
Type: "struct.method.get",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"name": "GetData",
|
"name": "GetData",
|
||||||
@@ -26,6 +27,10 @@ func TestStructMethodGetFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create struct.method.get processor: %s", err)
|
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" {
|
if processorInstance.Type() != "struct.method.get" {
|
||||||
t.Fatalf("struct.method.get processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("struct.method.get processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func TestTimeSleepFromRegistry(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processorInstance, err := registration.New(config.ProcessorConfig{
|
processorInstance, err := registration.New(config.ProcessorConfig{
|
||||||
|
Id: "test-id",
|
||||||
Type: "time.sleep",
|
Type: "time.sleep",
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"duration": 1000,
|
"duration": 1000,
|
||||||
@@ -25,6 +26,10 @@ func TestTimeSleepFromRegistry(t *testing.T) {
|
|||||||
t.Fatalf("failed to create time.sleep processor: %s", err)
|
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" {
|
if processorInstance.Type() != "time.sleep" {
|
||||||
t.Fatalf("time.sleep processor has wrong type: %s", processorInstance.Type())
|
t.Fatalf("time.sleep processor has wrong type: %s", processorInstance.Type())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ func (ts *TimeSleep) Process(ctx context.Context, wrappedPayload common.WrappedP
|
|||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ts *TimeSleep) Id() string {
|
||||||
|
return ts.config.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (ts *TimeSleep) Type() string {
|
func (ts *TimeSleep) Type() string {
|
||||||
return ts.config.Type
|
return ts.config.Type
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,13 +4,19 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/jwetzell/showbridge-go/internal/common"
|
"github.com/jwetzell/showbridge-go/internal/common"
|
||||||
|
"github.com/jwetzell/showbridge-go/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestProcessor struct {
|
type TestProcessor struct {
|
||||||
|
Config config.ProcessorConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *TestProcessor) Id() string {
|
||||||
|
return p.Config.Id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *TestProcessor) Type() string {
|
func (p *TestProcessor) Type() string {
|
||||||
return "test"
|
return p.Config.Type
|
||||||
}
|
}
|
||||||
func (p *TestProcessor) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
func (p *TestProcessor) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
|
||||||
return wrappedPayload, nil
|
return wrappedPayload, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user