Documentation ¶
Overview ¶
Package filter provides general-purpose core.Pipe implementations to filter (i.e. discard), sort or aggregate pipeline items.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDuplicate ¶
NewDuplicate instantiates a new filter which removes duplicates in the pipeline. Duplicates are identified by the given dedupField. Only one entry with the same value for the given field is allowed. In case of duplicates, the first entry received from the input channel has priority.
func NewSort ¶
NewSort instantiates a new filter, which gathers all entries of the input channel until the input channel is closed. Then, it sorts all entries according to the given field and order and writes the entries to the output channel.
func NewValidator ¶
NewValidator constructs a new Pipe, which uses the given validators to decide if incoming entries should be dropped.
Types ¶
type SortOrder ¶
type SortOrder int
SortOrder describes either ascending or descending order of items
type ValidatingFilter ¶
type ValidatingFilter struct {
// contains filtered or unexported fields
}
ValidatingFilter implements the core.Pipe interface, hence it is a stage in a pipeline. ValidatingFilter defines how Validation is orchestrated. This is a naive implementation: Entries are retrieved from the input channel. For each Entry retrieved, the given validators are called synchronously until a validation error occurs or all validators are passed. This procedure is performed for each Entry in the input channel, until the channel is closed. The policy in case of invalid Entries is, that these Entries are simply dropped (not passed to the output channel).