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