Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Event Types. LossyFeedEventType = "LOSSY_FEED" // Components. FeedsComponentType = "Feeds" )
View Source
const (
LoggingEventSinkType = "stdout"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct { EnabledEventTypes []string `yaml:"enabled_event_types"` DisabledEventTypes []string `yaml:"disabled_event_types"` EnabledComponents []string `yaml:"enabled_components"` }
func NewFilter ¶
Creates a filter for use with an event handler, nil can be provided for non values.
func (Filter) ShouldDispatch ¶
ShouldDispatch checks whether an event should be dispatched under the configured filter options. Options are applied as follows:
- disabled event types are always disabled.
- enabled event types are enabled
- enabled components are enabled except for disabled event types.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewNullHandler ¶
func NewNullHandler() *Handler
func (*Handler) DispatchEvent ¶
Dispatches an event to the configured sink if it passes the configured filter.
type LoggingEventSink ¶
type LoggingEventSink struct {
// contains filtered or unexported fields
}
func NewLoggingEventSink ¶
func NewLoggingEventSink(logger *logrus.Logger) *LoggingEventSink
Creates an event sink which logs events using a provided logrus logger, fields "component" and "event_type" are applied to the logger and warnings are logged for each event.
func (LoggingEventSink) AddEvent ¶
func (sink LoggingEventSink) AddEvent(e Event) error
type LossyFeedEvent ¶
type LossyFeedEvent struct {
Feed string
}
func (LossyFeedEvent) GetComponent ¶
func (e LossyFeedEvent) GetComponent() string
func (LossyFeedEvent) GetMessage ¶
func (e LossyFeedEvent) GetMessage() string
func (LossyFeedEvent) GetType ¶
func (e LossyFeedEvent) GetType() string
Click to show internal directories.
Click to hide internal directories.