Filter represents a data filter; a filter is a function that processes records. A filter can discard, transform, forward and even create records.
| 84 | // Filter represents a data filter; a filter is a function that processes |
| 85 | // records. A filter can discard, transform, forward and even create records. |
| 86 | type Filter interface { |
| 87 | // Process processes a single Record, and then optionally sends it to |
| 88 | // next filter in the chain. |
| 89 | // Process might mutate the Record, adding/modifying/removing fields, |
| 90 | // and might decide to throw it away, or pass it to next filter in chain |
| 91 | // by calling the next() function. In some cases, a filter might generate |
| 92 | // multiple Record in output, by calling next() multiple times. |
| 93 | // next() is guaranteed to be non-nil; for the last filter of the chain, |
| 94 | // it points to a function that wraps up the filtering chain and sends |
| 95 | // the Record to the output. |
| 96 | Process(l Record, next func(Record)) |
| 97 | |
| 98 | // Stats returns stats about the filter |
| 99 | Stats() FilterStats |
| 100 | } |
| 101 | |
| 102 | // Output is the final end of a topology, it process the records that have |
| 103 | // reached the end of the filter chain and performs the final action (storing, |
no outgoing calls
no test coverage detected