Documentation ¶
Overview ¶
Package filters contains all there is to the Filterable interface. This is a interface that Payload types can inccorporate so that they can pass through this filter function
Index ¶
- Variables
- func NewFilterHandler() handlers.Handler
- type FilterHandler
- func (a *FilterHandler) GetConfiguration() *property.Configuration
- func (a *FilterHandler) GetErrorChannel() chan error
- func (a *FilterHandler) GetHandlerName() string
- func (a *FilterHandler) Handle(ctx context.Context, input payload.Payload, topics ...string) error
- func (a *FilterHandler) SetMetricProvider(p metric.Provider, prefix string) error
- func (a *FilterHandler) Subscriptionless() bool
- func (a *FilterHandler) ValidateConfiguration() (bool, []string)
Constants ¶
This section is empty.
Variables ¶
var ( //ErrNotFilterablePayload is thrown when the input payload does not fulfill filterable ErrNotFilterablePayload error = errors.New("The input payload is not filterable") )
Functions ¶
func NewFilterHandler ¶
NewFilterHandler generates a new Filter Handler
Types ¶
type FilterHandler ¶
type FilterHandler struct { // Cfg is values needed to properly run the Handle func Cfg *property.Configuration `json:"configs" yaml:"configs"` Name string `json:"name" yaml:"handler_name"` // MetricPayloadOut is how many payloads the processor has outputted MetricPayloadOut string // MetricPayloadIn is how many payloads the processor has inputted MetricPayloadIn string // contains filtered or unexported fields }
FilterHandler is used to filter out payloads that contains the wanted values
func (*FilterHandler) GetConfiguration ¶
func (a *FilterHandler) GetConfiguration() *property.Configuration
GetConfiguration will return the CFG for the Handler
func (*FilterHandler) GetErrorChannel ¶
func (a *FilterHandler) GetErrorChannel() chan error
GetErrorChannel will return a channel that the Handler can output eventual errors onto
func (*FilterHandler) GetHandlerName ¶
func (a *FilterHandler) GetHandlerName() string
GetHandlerName is used to retrun a unqiue string name
func (*FilterHandler) Handle ¶
Handle is used to check if payload is of Filterable type, then apply Filter to it
func (*FilterHandler) SetMetricProvider ¶
func (a *FilterHandler) SetMetricProvider(p metric.Provider, prefix string) error
SetMetricProvider is used to change what metrics provider is used by the handler
func (*FilterHandler) Subscriptionless ¶
func (a *FilterHandler) Subscriptionless() bool
Subscriptionless will return true/false if the Handler is genereating payloads itself
func (*FilterHandler) ValidateConfiguration ¶
func (a *FilterHandler) ValidateConfiguration() (bool, []string)
ValidateConfiguration is used to see that all needed configurations are assigned before starting