github.com/Jeffail/benthos/v3@v3.65.0/lib/processor/type.go (about) 1 package processor 2 3 import ( 4 "github.com/Jeffail/benthos/v3/lib/types" 5 ) 6 7 //------------------------------------------------------------------------------ 8 9 // Type reads a message, performs a processing operation, and returns either a 10 // slice of messages resulting from the process to be propagated through the 11 // pipeline, or a response that should be sent back to the source instead. 12 type Type interface { 13 // ProcessMessage attempts to process a message. Since processing can fail 14 // this call returns both a slice of messages in case of success or a 15 // response in case of failure. If the slice of messages is empty the 16 // response should be returned to the source. 17 ProcessMessage(msg types.Message) ([]types.Message, types.Response) 18 19 types.Closable 20 } 21 22 //------------------------------------------------------------------------------