Documentation ¶
Index ¶
- Constants
- func NewEventDispatcher(eb baseEventSubscriber) flowEventDispatcher
- type ActionFlow
- type AllowedEvents
- type Cooldown
- type Description
- type EventFlow
- type EventFlowStatus
- type Filters
- type Flow
- type FlowConfig
- type FlowConfigs
- type FlowManager
- type FlowStore
- type GroupBy
- type InMemoryFlowStore
- type Manager
- type Option
- type Plugins
Constants ¶
const (
CEIncomingTopic = "cloud.events.incoming"
)
Variables ¶
This section is empty.
Functions ¶
func NewEventDispatcher ¶
func NewEventDispatcher(eb baseEventSubscriber) flowEventDispatcher
NewEventDispatcher returns an initialized eventDispatcher
Types ¶
type ActionFlow ¶
type ActionFlow interface {
Handle(event interface{})
}
ActionFlow defines an action flow
type AllowedEvents ¶
type AllowedEvents []string
AllowedEvents defines allowed event types for the flow
type EventFlow ¶
type EventFlow struct { Status EventFlowStatus Error error // contains filtered or unexported fields }
EventFlow is an actual sequential executing of defined plugins for a particular event and a defined action flow
func NewEventFlow ¶
NewEventFlow returns an initialized EventFlow
type EventFlowStatus ¶
type EventFlowStatus string
const ( EventFlowCompleted EventFlowStatus = "completed" EventFlowFailed EventFlowStatus = "failed" EventFlowInProgress EventFlowStatus = "inprogress" EventFlowInitialized EventFlowStatus = "initialized" EventFlowCoolingDown EventFlowStatus = "coolingdown" )
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
Flow describes an action flow
type FlowConfig ¶
type FlowConfig struct { Name string `mapstructure:"name"` Plugins []string `mapstructure:"plugins"` Description string `mapstructure:"description"` AllowedEvents []string `mapstructure:"allowedEvents"` GroupBy []string `mapstructure:"groupBy"` Filters map[string]string `mapstructure:"filters"` Cooldown time.Duration `mapstructure:"cooldown"` }
FlowConfig holds configuration values for an action flow
func (FlowConfig) Validate ¶
func (c FlowConfig) Validate(plugins plugin.PluginManager, id string) error
Validate validates flow configuration
type FlowConfigs ¶
type FlowConfigs map[string]FlowConfig
type FlowManager ¶
type FlowManager interface { Logger() log.Logger ErrorHandler() emperror.Handler Plugins() plugin.PluginManager }
FlowManager is used for managing action flows
type GroupBy ¶
type GroupBy []string
GroupBy categorizes subsequent events as the same if all the corresponding values of these attributes match
type InMemoryFlowStore ¶
func NewInMemFlowStore ¶
func NewInMemFlowStore() *InMemoryFlowStore
func (*InMemoryFlowStore) Delete ¶
func (i *InMemoryFlowStore) Delete(key string)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager describes a FlowManager implementation
func NewManager ¶
func NewManager(logger log.Logger, errorHandler emperror.Handler, dispatcher flowEventDispatcher, plugins plugin.PluginManager) *Manager
NewManager returns an initialized FlowManager implementation
func (*Manager) ErrorHandler ¶
ErrorHandler returns the error handler
func (*Manager) LoadFlows ¶
LoadFlows loads flow definitions from config, initializes Flows and subscribes them to the event dispatcher
func (*Manager) Plugins ¶
func (m *Manager) Plugins() plugin.PluginManager
Plugins returns the plugin manager