wrap payload for all processors

This commit is contained in:
Joel Wetzell
2026-03-16 17:05:49 -05:00
parent b6c1c5c600
commit f273aedbc6
76 changed files with 674 additions and 486 deletions

View File

@@ -13,18 +13,22 @@ type FreeDDecode struct {
config config.ProcessorConfig
}
func (fd *FreeDDecode) Process(ctx context.Context, payload any) (any, error) {
func (fd *FreeDDecode) Process(ctx context.Context, wrappedPayload common.WrappedPayload) (common.WrappedPayload, error) {
payload := wrappedPayload.Payload
payloadBytes, ok := common.GetAnyAs[[]byte](payload)
if !ok {
return nil, errors.New("freed.decode processor only accepts a []byte")
wrappedPayload.End = true
return wrappedPayload, errors.New("freed.decode processor only accepts a []byte")
}
payloadMessage, err := freeD.Decode(payloadBytes)
if err != nil {
return nil, err
wrappedPayload.End = true
return wrappedPayload, err
}
return payloadMessage, nil
wrappedPayload.Payload = payloadMessage
return wrappedPayload, nil
}
func (fd *FreeDDecode) Type() string {