Documentation
¶
Overview ¶
Package firehose provides an event processing pipeline framework.
Index ¶
- Variables
- func EventID(event any) (uint64, error)
- func EventSymbols(event any) boolexpr.Symbols
- func NewRuleError(rule string, err error) error
- func Start(ctx context.Context, head Rule, errFunc ErrorHandler) []<-chan struct{}
- type Action
- type ActionError
- type Callback
- type Condition
- type ConditionError
- type Destination
- type DestinationError
- type ErrorHandler
- type MapReduceRule
- func (r *MapReduceRule[I, M, Out]) GetEnvironments() []string
- func (r *MapReduceRule[I, M, Out]) GetID() string
- func (r *MapReduceRule[I, M, Out]) GetNext() Rule
- func (r *MapReduceRule[I, M, Out]) GetNextSameSource() Rule
- func (r *MapReduceRule[I, M, Out]) GetPrev() Rule
- func (r *MapReduceRule[I, M, Out]) GetPrevSameSource() Rule
- func (r *MapReduceRule[I, M, Out]) GetSource() any
- func (r *MapReduceRule[I, M, Out]) Init(ctx context.Context) error
- func (r *MapReduceRule[I, M, Out]) NextRunnable() Runnable[I]
- func (r *MapReduceRule[I, M, Out]) Run(ctx context.Context, event I, syms boolexpr.Symbols) error
- func (r *MapReduceRule[I, M, Out]) SetNext(n Rule)
- func (r *MapReduceRule[I, M, Out]) SetNextSameSource(n Rule)
- func (r *MapReduceRule[I, M, Out]) SetPrev(p Rule)
- func (r *MapReduceRule[I, M, Out]) SetPrevSameSource(p Rule)
- func (r *MapReduceRule[I, M, Out]) Start(ctx context.Context) (<-chan struct{}, error)
- type Middleware
- type MockAction
- type MockAction_Expecter
- type MockAction_Process_Call
- func (_c *MockAction_Process_Call[I, O]) Return(v O, err error) *MockAction_Process_Call[I, O]
- func (_c *MockAction_Process_Call[I, O]) Run(run func(ctx context.Context, event I, syms boolexpr.Symbols)) *MockAction_Process_Call[I, O]
- func (_c *MockAction_Process_Call[I, O]) RunAndReturn(run func(ctx context.Context, event I, syms boolexpr.Symbols) (O, error)) *MockAction_Process_Call[I, O]
- type MockCondition
- type MockCondition_Evaluate_Call
- func (_c *MockCondition_Evaluate_Call[I]) Return(b bool, err error) *MockCondition_Evaluate_Call[I]
- func (_c *MockCondition_Evaluate_Call[I]) Run(run func(ctx context.Context, event I, syms boolexpr.Symbols)) *MockCondition_Evaluate_Call[I]
- func (_c *MockCondition_Evaluate_Call[I]) RunAndReturn(run func(ctx context.Context, event I, syms boolexpr.Symbols) (bool, error)) *MockCondition_Evaluate_Call[I]
- type MockCondition_Expecter
- type MockDestination
- type MockDestination_Expecter
- type MockDestination_Send_Call
- func (_c *MockDestination_Send_Call[T]) Return(err error) *MockDestination_Send_Call[T]
- func (_c *MockDestination_Send_Call[T]) Run(run func(ctx context.Context, event T)) *MockDestination_Send_Call[T]
- func (_c *MockDestination_Send_Call[T]) RunAndReturn(run func(ctx context.Context, event T) error) *MockDestination_Send_Call[T]
- type MockMiddleware
- func (_m *MockMiddleware[I, O]) EXPECT() *MockMiddleware_Expecter[I, O]
- func (_mock *MockMiddleware[I, O]) WrapAction(ctx context.Context, rule Rule, action Action[I, O]) (Action[I, O], error)
- func (_mock *MockMiddleware[I, O]) WrapCallback(ctx context.Context, rule Rule, callback Callback[I]) (Callback[I], error)
- func (_mock *MockMiddleware[I, O]) WrapDestination(ctx context.Context, rule Rule, destination Destination[O]) (Destination[O], error)
- type MockMiddleware_Expecter
- func (_e *MockMiddleware_Expecter[I, O]) WrapAction(ctx any, rule any, action any) *MockMiddleware_WrapAction_Call[I, O]
- func (_e *MockMiddleware_Expecter[I, O]) WrapCallback(ctx any, rule any, callback any) *MockMiddleware_WrapCallback_Call[I, O]
- func (_e *MockMiddleware_Expecter[I, O]) WrapDestination(ctx any, rule any, destination any) *MockMiddleware_WrapDestination_Call[I, O]
- type MockMiddleware_WrapAction_Call
- func (_c *MockMiddleware_WrapAction_Call[I, O]) Return(action1 Action[I, O], err error) *MockMiddleware_WrapAction_Call[I, O]
- func (_c *MockMiddleware_WrapAction_Call[I, O]) Run(run func(ctx context.Context, rule Rule, action Action[I, O])) *MockMiddleware_WrapAction_Call[I, O]
- func (_c *MockMiddleware_WrapAction_Call[I, O]) RunAndReturn(...) *MockMiddleware_WrapAction_Call[I, O]
- type MockMiddleware_WrapCallback_Call
- func (_c *MockMiddleware_WrapCallback_Call[I, O]) Return(callback1 Callback[I], err error) *MockMiddleware_WrapCallback_Call[I, O]
- func (_c *MockMiddleware_WrapCallback_Call[I, O]) Run(run func(ctx context.Context, rule Rule, callback Callback[I])) *MockMiddleware_WrapCallback_Call[I, O]
- func (_c *MockMiddleware_WrapCallback_Call[I, O]) RunAndReturn(...) *MockMiddleware_WrapCallback_Call[I, O]
- type MockMiddleware_WrapDestination_Call
- func (_c *MockMiddleware_WrapDestination_Call[I, O]) Return(destination1 Destination[O], err error) *MockMiddleware_WrapDestination_Call[I, O]
- func (_c *MockMiddleware_WrapDestination_Call[I, O]) Run(run func(ctx context.Context, rule Rule, destination Destination[O])) *MockMiddleware_WrapDestination_Call[I, O]
- func (_c *MockMiddleware_WrapDestination_Call[I, O]) RunAndReturn(...) *MockMiddleware_WrapDestination_Call[I, O]
- type MockReducer
- type MockReducer_Expecter
- type MockReducer_Reduce_Call
- func (_c *MockReducer_Reduce_Call[M, Out]) Return(v Out, err error) *MockReducer_Reduce_Call[M, Out]
- func (_c *MockReducer_Reduce_Call[M, Out]) Run(run func(ctx context.Context, intermediary M, accumulator Out)) *MockReducer_Reduce_Call[M, Out]
- func (_c *MockReducer_Reduce_Call[M, Out]) RunAndReturn(run func(ctx context.Context, intermediary M, accumulator Out) (Out, error)) *MockReducer_Reduce_Call[M, Out]
- type MockRule
- func (_m *MockRule) EXPECT() *MockRule_Expecter
- func (_mock *MockRule) GetEnvironments() []string
- func (_mock *MockRule) GetID() string
- func (_mock *MockRule) GetNext() Rule
- func (_mock *MockRule) GetNextSameSource() Rule
- func (_mock *MockRule) GetPrev() Rule
- func (_mock *MockRule) GetSource() any
- func (_mock *MockRule) Init(ctx context.Context) error
- func (_mock *MockRule) SetNext(n Rule)
- func (_mock *MockRule) SetNextSameSource(n Rule)
- func (_mock *MockRule) SetPrev(p Rule)
- func (_mock *MockRule) SetPrevSameSource(p Rule)
- func (_mock *MockRule) Start(ctx context.Context) (<-chan struct{}, error)
- type MockRule_Expecter
- func (_e *MockRule_Expecter) GetEnvironments() *MockRule_GetEnvironments_Call
- func (_e *MockRule_Expecter) GetID() *MockRule_GetID_Call
- func (_e *MockRule_Expecter) GetNext() *MockRule_GetNext_Call
- func (_e *MockRule_Expecter) GetNextSameSource() *MockRule_GetNextSameSource_Call
- func (_e *MockRule_Expecter) GetPrev() *MockRule_GetPrev_Call
- func (_e *MockRule_Expecter) GetSource() *MockRule_GetSource_Call
- func (_e *MockRule_Expecter) Init(ctx any) *MockRule_Init_Call
- func (_e *MockRule_Expecter) SetNext(n any) *MockRule_SetNext_Call
- func (_e *MockRule_Expecter) SetNextSameSource(n any) *MockRule_SetNextSameSource_Call
- func (_e *MockRule_Expecter) SetPrev(p any) *MockRule_SetPrev_Call
- func (_e *MockRule_Expecter) SetPrevSameSource(p any) *MockRule_SetPrevSameSource_Call
- func (_e *MockRule_Expecter) Start(ctx any) *MockRule_Start_Call
- type MockRule_GetEnvironments_Call
- type MockRule_GetID_Call
- type MockRule_GetNextSameSource_Call
- type MockRule_GetNext_Call
- type MockRule_GetPrev_Call
- type MockRule_GetSource_Call
- type MockRule_Init_Call
- type MockRule_SetNextSameSource_Call
- type MockRule_SetNext_Call
- type MockRule_SetPrevSameSource_Call
- type MockRule_SetPrev_Call
- type MockRule_Start_Call
- func (_c *MockRule_Start_Call) Return(valCh <-chan struct{}, err error) *MockRule_Start_Call
- func (_c *MockRule_Start_Call) Run(run func(ctx context.Context)) *MockRule_Start_Call
- func (_c *MockRule_Start_Call) RunAndReturn(run func(ctx context.Context) (<-chan struct{}, error)) *MockRule_Start_Call
- type MockRunnable
- type MockRunnable_Expecter
- type MockRunnable_NextRunnable_Call
- func (_c *MockRunnable_NextRunnable_Call[I]) Return(runnable Runnable[I]) *MockRunnable_NextRunnable_Call[I]
- func (_c *MockRunnable_NextRunnable_Call[I]) Run(run func()) *MockRunnable_NextRunnable_Call[I]
- func (_c *MockRunnable_NextRunnable_Call[I]) RunAndReturn(run func() Runnable[I]) *MockRunnable_NextRunnable_Call[I]
- type MockRunnable_Run_Call
- func (_c *MockRunnable_Run_Call[I]) Return(err error) *MockRunnable_Run_Call[I]
- func (_c *MockRunnable_Run_Call[I]) Run(run func(ctx context.Context, event I, syms boolexpr.Symbols)) *MockRunnable_Run_Call[I]
- func (_c *MockRunnable_Run_Call[I]) RunAndReturn(run func(ctx context.Context, event I, syms boolexpr.Symbols) error) *MockRunnable_Run_Call[I]
- type MockSource
- type MockSource_Expecter
- type MockSource_Start_Call
- func (_c *MockSource_Start_Call[T]) Return(done <-chan struct{}, err error) *MockSource_Start_Call[T]
- func (_c *MockSource_Start_Call[T]) Run(run func(ctx context.Context, cb Callback[T])) *MockSource_Start_Call[T]
- func (_c *MockSource_Start_Call[T]) RunAndReturn(run func(ctx context.Context, cb Callback[T]) (<-chan struct{}, error)) *MockSource_Start_Call[T]
- type ReduceError
- type Reducer
- type Rule
- type RuleError
- type Runnable
- type SQLRule
- func (r *SQLRule[I, O]) GetEnvironments() []string
- func (r *SQLRule[I, O]) GetID() string
- func (r *SQLRule[I, O]) GetNext() Rule
- func (r *SQLRule[I, O]) GetNextSameSource() Rule
- func (r *SQLRule[I, O]) GetPrev() Rule
- func (r *SQLRule[I, O]) GetSource() any
- func (r *SQLRule[I, O]) Init(ctx context.Context) error
- func (r *SQLRule[I, O]) NextRunnable() Runnable[I]
- func (r *SQLRule[I, O]) Run(ctx context.Context, event I, syms boolexpr.Symbols) error
- func (r *SQLRule[I, O]) SetNext(n Rule)
- func (r *SQLRule[I, O]) SetNextSameSource(n Rule)
- func (r *SQLRule[I, O]) SetPrev(p Rule)
- func (r *SQLRule[I, O]) SetPrevSameSource(p Rule)
- func (r *SQLRule[I, O]) Start(ctx context.Context) (<-chan struct{}, error)
- type ScenarioRule
- func (r *ScenarioRule[I, O]) GetEnvironments() []string
- func (r *ScenarioRule[I, O]) GetID() string
- func (r *ScenarioRule[I, O]) GetNext() Rule
- func (r *ScenarioRule[I, O]) GetNextSameSource() Rule
- func (r *ScenarioRule[I, O]) GetPrev() Rule
- func (r *ScenarioRule[I, O]) GetPrevSameSource() Rule
- func (r *ScenarioRule[I, O]) GetSource() any
- func (r *ScenarioRule[I, O]) Init(ctx context.Context) error
- func (r *ScenarioRule[I, O]) NextRunnable() Runnable[I]
- func (r *ScenarioRule[I, O]) Run(ctx context.Context, event I, syms boolexpr.Symbols) error
- func (r *ScenarioRule[I, O]) SetNext(n Rule)
- func (r *ScenarioRule[I, O]) SetNextSameSource(n Rule)
- func (r *ScenarioRule[I, O]) SetPrev(p Rule)
- func (r *ScenarioRule[I, O]) SetPrevSameSource(p Rule)
- func (r *ScenarioRule[I, O]) Start(ctx context.Context) (<-chan struct{}, error)
- type Source
- type StreamRule
- func (r *StreamRule[I, O]) GetEnvironments() []string
- func (r *StreamRule[I, O]) GetID() string
- func (r *StreamRule[I, O]) GetNext() Rule
- func (r *StreamRule[I, O]) GetNextSameSource() Rule
- func (r *StreamRule[I, O]) GetPrev() Rule
- func (r *StreamRule[I, O]) GetPrevSameSource() Rule
- func (r *StreamRule[I, O]) GetSource() any
- func (r *StreamRule[I, O]) Init(ctx context.Context) error
- func (r *StreamRule[I, O]) NextRunnable() Runnable[I]
- func (r *StreamRule[I, O]) Run(ctx context.Context, event I, syms boolexpr.Symbols) error
- func (r *StreamRule[I, O]) SetNext(n Rule)
- func (r *StreamRule[I, O]) SetNextSameSource(n Rule)
- func (r *StreamRule[I, O]) SetPrev(p Rule)
- func (r *StreamRule[I, O]) SetPrevSameSource(p Rule)
- func (r *StreamRule[I, O]) Start(ctx context.Context) (<-chan struct{}, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInputNoMatch = errors.New("no match") ErrOutputNoMatch = errors.New("output no match") )
Sentinel errors used for control flow and classification.
Functions ¶
func EventSymbols ¶
EventSymbols extracts symbols from an event if it implements boolexpr.Symbols. Events can embed boolexpr.Symbols directly to provide attribute access for condition evaluation. Returns a cached wrapper around the symbols for efficient repeated lookups. If the event doesn't implement boolexpr.Symbols, returns an empty SymbolsMap directly (no caching needed).
func NewRuleError ¶
NewRuleError creates an error with the given rule and underlying error.
Types ¶
type Action ¶
type Action[I, O any] interface { Process(ctx context.Context, event I, syms boolexpr.Symbols) (O, error) }
Action transforms input events to output events.
type ActionError ¶
type ActionError struct{ Err error }
ActionError wraps an error returned by Action.Process.
func (ActionError) Error ¶
func (e ActionError) Error() string
func (ActionError) Unwrap ¶
func (e ActionError) Unwrap() error
type Callback ¶
type Callback[I any] func(context.Context, I, ErrorHandler)
Callback is a function type that sources use to send events to the engine. It takes a context, an event, and a report sink callback.
type Condition ¶
type Condition[I any] interface { Evaluate(ctx context.Context, event I, syms boolexpr.Symbols) (bool, error) }
Condition evaluates whether an event should be processed by a rule. It receives the context, event, and symbols extracted from the event attributes, and returns true if the condition is met, false otherwise, along with any error.
type ConditionError ¶
type ConditionError struct{ Err error }
ConditionError wraps an error that occurred during If evaluation.
func (ConditionError) Error ¶
func (e ConditionError) Error() string
func (ConditionError) Unwrap ¶
func (e ConditionError) Unwrap() error
type Destination ¶
Destination consumes events of type T.
type DestinationError ¶
type DestinationError struct{ Err error }
DestinationError wraps an error returned by Destination.Send.
func (DestinationError) Error ¶
func (e DestinationError) Error() string
func (DestinationError) Unwrap ¶
func (e DestinationError) Unwrap() error
type ErrorHandler ¶
type ErrorHandler func(err error)
ErrorHandler is a callback function type that handles errors occurring during event processing.
type MapReduceRule ¶
type MapReduceRule[I, M, Out any] struct { // ID is a unique identifier for the rule. ID string `validate:"required"` // Environments is a list of environment names where the rule is active. Environments []string // Source is the source that produces events to be processed by this rule. Source Source[I] `validate:"required"` // Filter is a condition that must evaluate to true for the rule to process // the event. Filter Condition[I] // Map transforms input events into intermediary values. Map Action[I, M] `validate:"required"` // Reduce combines an intermediary value with the current accumulator to // produce a new output value. Reduce Reducer[M, Out] `validate:"required"` // FilterOutput is a condition that must evaluate to true for the rule to // send the reduced output to the Sink destination. FilterOutput Condition[Out] // Sink is the destination that consumes the reduced output. Sink Destination[Out] `validate:"required"` // Middlewares are applied to the callback and Map action. Middlewares wrap // in reverse order (first middleware wraps last). Note: middlewares only // wrap the callback and Map action — the Sink destination type (Out) // differs from the intermediary type (M), so destination wrapping is not // supported. Middlewares []Middleware[I, M] // contains filtered or unexported fields }
MapReduceRule defines an event processing pipeline following the MapReduce pattern. I is the input event type, M is the intermediary type produced by Map, and Out is the accumulated output type.
Pipeline: Source → Filter → Map (I → M) → Reduce (M + Out → Out) →
FilterOutput → Sink.
func (*MapReduceRule[I, M, Out]) GetEnvironments ¶
func (r *MapReduceRule[I, M, Out]) GetEnvironments() []string
GetEnvironments returns the list of environments where the rule is active.
func (*MapReduceRule[I, M, Out]) GetID ¶
func (r *MapReduceRule[I, M, Out]) GetID() string
GetID returns the unique identifier of the rule.
func (*MapReduceRule[I, M, Out]) GetNext ¶
func (r *MapReduceRule[I, M, Out]) GetNext() Rule
GetNext returns the next rule in the circular rule list.
func (*MapReduceRule[I, M, Out]) GetNextSameSource ¶
func (r *MapReduceRule[I, M, Out]) GetNextSameSource() Rule
GetNextSameSource returns the next rule sharing the same source.
func (*MapReduceRule[I, M, Out]) GetPrev ¶
func (r *MapReduceRule[I, M, Out]) GetPrev() Rule
GetPrev returns the previous rule in the circular rule list.
func (*MapReduceRule[I, M, Out]) GetPrevSameSource ¶
func (r *MapReduceRule[I, M, Out]) GetPrevSameSource() Rule
GetPrevSameSource returns the previous rule sharing the same source.
func (*MapReduceRule[I, M, Out]) GetSource ¶
func (r *MapReduceRule[I, M, Out]) GetSource() any
GetSource returns the source associated with this rule.
func (*MapReduceRule[I, M, Out]) Init ¶
func (r *MapReduceRule[I, M, Out]) Init(ctx context.Context) error
Init initializes the rule by wrapping the callback and Map action with the configured middlewares. Middlewares are applied in reverse order.
func (*MapReduceRule[I, M, Out]) NextRunnable ¶
func (r *MapReduceRule[I, M, Out]) NextRunnable() Runnable[I]
NextRunnable returns the next runnable rule with the same source.
func (*MapReduceRule[I, M, Out]) Run ¶
Run maps the input event to an intermediary value, reduces it with the current accumulator, then sends the result to the sink.
func (*MapReduceRule[I, M, Out]) SetNext ¶
func (r *MapReduceRule[I, M, Out]) SetNext(n Rule)
SetNext sets the next rule in the circular rule list.
func (*MapReduceRule[I, M, Out]) SetNextSameSource ¶
func (r *MapReduceRule[I, M, Out]) SetNextSameSource(n Rule)
SetNextSameSource sets the next rule sharing the same source.
func (*MapReduceRule[I, M, Out]) SetPrev ¶
func (r *MapReduceRule[I, M, Out]) SetPrev(p Rule)
SetPrev sets the previous rule in the circular rule list.
func (*MapReduceRule[I, M, Out]) SetPrevSameSource ¶
func (r *MapReduceRule[I, M, Out]) SetPrevSameSource(p Rule)
SetPrevSameSource sets the previous rule sharing the same source.
type Middleware ¶
type Middleware[I, O any] interface { WrapCallback(ctx context.Context, rule Rule, callback Callback[I]) (Callback[I], error) WrapAction(ctx context.Context, rule Rule, action Action[I, O]) (Action[I, O], error) WrapDestination(ctx context.Context, rule Rule, destination Destination[O]) (Destination[O], error) }
Middleware wraps callbacks, actions, and destinations to add cross-cutting concerns such as conditional execution, panic recovery, logging, retry logic, or telemetry.
type MockAction ¶
MockAction is an autogenerated mock type for the Action type
func NewMockAction ¶
func NewMockAction[I any, O any](t interface { mock.TestingT Cleanup(func()) }) *MockAction[I, O]
NewMockAction creates a new instance of MockAction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockAction[I, O]) EXPECT ¶
func (_m *MockAction[I, O]) EXPECT() *MockAction_Expecter[I, O]
type MockAction_Expecter ¶
func (*MockAction_Expecter[I, O]) Process ¶
func (_e *MockAction_Expecter[I, O]) Process(ctx any, event any, syms any) *MockAction_Process_Call[I, O]
Process is a helper method to define mock.On call
- ctx context.Context
- event I
- syms boolexpr.Symbols
type MockAction_Process_Call ¶
MockAction_Process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Process'
func (*MockAction_Process_Call[I, O]) Return ¶
func (_c *MockAction_Process_Call[I, O]) Return(v O, err error) *MockAction_Process_Call[I, O]
func (*MockAction_Process_Call[I, O]) Run ¶
func (_c *MockAction_Process_Call[I, O]) Run(run func(ctx context.Context, event I, syms boolexpr.Symbols)) *MockAction_Process_Call[I, O]
func (*MockAction_Process_Call[I, O]) RunAndReturn ¶
func (_c *MockAction_Process_Call[I, O]) RunAndReturn(run func(ctx context.Context, event I, syms boolexpr.Symbols) (O, error)) *MockAction_Process_Call[I, O]
type MockCondition ¶
MockCondition is an autogenerated mock type for the Condition type
func NewMockCondition ¶
func NewMockCondition[I any](t interface { mock.TestingT Cleanup(func()) }) *MockCondition[I]
NewMockCondition creates a new instance of MockCondition. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockCondition[I]) EXPECT ¶
func (_m *MockCondition[I]) EXPECT() *MockCondition_Expecter[I]
type MockCondition_Evaluate_Call ¶
MockCondition_Evaluate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Evaluate'
func (*MockCondition_Evaluate_Call[I]) Return ¶
func (_c *MockCondition_Evaluate_Call[I]) Return(b bool, err error) *MockCondition_Evaluate_Call[I]
func (*MockCondition_Evaluate_Call[I]) Run ¶
func (_c *MockCondition_Evaluate_Call[I]) Run(run func(ctx context.Context, event I, syms boolexpr.Symbols)) *MockCondition_Evaluate_Call[I]
func (*MockCondition_Evaluate_Call[I]) RunAndReturn ¶
func (_c *MockCondition_Evaluate_Call[I]) RunAndReturn(run func(ctx context.Context, event I, syms boolexpr.Symbols) (bool, error)) *MockCondition_Evaluate_Call[I]
type MockCondition_Expecter ¶
type MockCondition_Expecter[I any] struct { // contains filtered or unexported fields }
func (*MockCondition_Expecter[I]) Evaluate ¶
func (_e *MockCondition_Expecter[I]) Evaluate(ctx any, event any, syms any) *MockCondition_Evaluate_Call[I]
Evaluate is a helper method to define mock.On call
- ctx context.Context
- event I
- syms boolexpr.Symbols
type MockDestination ¶
MockDestination is an autogenerated mock type for the Destination type
func NewMockDestination ¶
func NewMockDestination[T any](t interface { mock.TestingT Cleanup(func()) }) *MockDestination[T]
NewMockDestination creates a new instance of MockDestination. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockDestination[T]) EXPECT ¶
func (_m *MockDestination[T]) EXPECT() *MockDestination_Expecter[T]
type MockDestination_Expecter ¶
type MockDestination_Expecter[T any] struct { // contains filtered or unexported fields }
func (*MockDestination_Expecter[T]) Send ¶
func (_e *MockDestination_Expecter[T]) Send(ctx any, event any) *MockDestination_Send_Call[T]
Send is a helper method to define mock.On call
- ctx context.Context
- event T
type MockDestination_Send_Call ¶
MockDestination_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send'
func (*MockDestination_Send_Call[T]) Return ¶
func (_c *MockDestination_Send_Call[T]) Return(err error) *MockDestination_Send_Call[T]
func (*MockDestination_Send_Call[T]) Run ¶
func (_c *MockDestination_Send_Call[T]) Run(run func(ctx context.Context, event T)) *MockDestination_Send_Call[T]
func (*MockDestination_Send_Call[T]) RunAndReturn ¶
func (_c *MockDestination_Send_Call[T]) RunAndReturn(run func(ctx context.Context, event T) error) *MockDestination_Send_Call[T]
type MockMiddleware ¶
MockMiddleware is an autogenerated mock type for the Middleware type
func NewMockMiddleware ¶
func NewMockMiddleware[I any, O any](t interface { mock.TestingT Cleanup(func()) }) *MockMiddleware[I, O]
NewMockMiddleware creates a new instance of MockMiddleware. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockMiddleware[I, O]) EXPECT ¶
func (_m *MockMiddleware[I, O]) EXPECT() *MockMiddleware_Expecter[I, O]
func (*MockMiddleware[I, O]) WrapAction ¶
func (_mock *MockMiddleware[I, O]) WrapAction(ctx context.Context, rule Rule, action Action[I, O]) (Action[I, O], error)
WrapAction provides a mock function for the type MockMiddleware
func (*MockMiddleware[I, O]) WrapCallback ¶
func (_mock *MockMiddleware[I, O]) WrapCallback(ctx context.Context, rule Rule, callback Callback[I]) (Callback[I], error)
WrapCallback provides a mock function for the type MockMiddleware
func (*MockMiddleware[I, O]) WrapDestination ¶
func (_mock *MockMiddleware[I, O]) WrapDestination(ctx context.Context, rule Rule, destination Destination[O]) (Destination[O], error)
WrapDestination provides a mock function for the type MockMiddleware
type MockMiddleware_Expecter ¶
func (*MockMiddleware_Expecter[I, O]) WrapAction ¶
func (_e *MockMiddleware_Expecter[I, O]) WrapAction(ctx any, rule any, action any) *MockMiddleware_WrapAction_Call[I, O]
WrapAction is a helper method to define mock.On call
- ctx context.Context
- rule Rule
- action Action[I, O]
func (*MockMiddleware_Expecter[I, O]) WrapCallback ¶
func (_e *MockMiddleware_Expecter[I, O]) WrapCallback(ctx any, rule any, callback any) *MockMiddleware_WrapCallback_Call[I, O]
WrapCallback is a helper method to define mock.On call
- ctx context.Context
- rule Rule
- callback Callback[I]
func (*MockMiddleware_Expecter[I, O]) WrapDestination ¶
func (_e *MockMiddleware_Expecter[I, O]) WrapDestination(ctx any, rule any, destination any) *MockMiddleware_WrapDestination_Call[I, O]
WrapDestination is a helper method to define mock.On call
- ctx context.Context
- rule Rule
- destination Destination[O]
type MockMiddleware_WrapAction_Call ¶
MockMiddleware_WrapAction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WrapAction'
func (*MockMiddleware_WrapAction_Call[I, O]) Return ¶
func (_c *MockMiddleware_WrapAction_Call[I, O]) Return(action1 Action[I, O], err error) *MockMiddleware_WrapAction_Call[I, O]
func (*MockMiddleware_WrapAction_Call[I, O]) Run ¶
func (_c *MockMiddleware_WrapAction_Call[I, O]) Run(run func(ctx context.Context, rule Rule, action Action[I, O])) *MockMiddleware_WrapAction_Call[I, O]
func (*MockMiddleware_WrapAction_Call[I, O]) RunAndReturn ¶
func (_c *MockMiddleware_WrapAction_Call[I, O]) RunAndReturn(run func(ctx context.Context, rule Rule, action Action[I, O]) (Action[I, O], error)) *MockMiddleware_WrapAction_Call[I, O]
type MockMiddleware_WrapCallback_Call ¶
MockMiddleware_WrapCallback_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WrapCallback'
func (*MockMiddleware_WrapCallback_Call[I, O]) Return ¶
func (_c *MockMiddleware_WrapCallback_Call[I, O]) Return(callback1 Callback[I], err error) *MockMiddleware_WrapCallback_Call[I, O]
func (*MockMiddleware_WrapCallback_Call[I, O]) Run ¶
func (_c *MockMiddleware_WrapCallback_Call[I, O]) Run(run func(ctx context.Context, rule Rule, callback Callback[I])) *MockMiddleware_WrapCallback_Call[I, O]
func (*MockMiddleware_WrapCallback_Call[I, O]) RunAndReturn ¶
func (_c *MockMiddleware_WrapCallback_Call[I, O]) RunAndReturn(run func(ctx context.Context, rule Rule, callback Callback[I]) (Callback[I], error)) *MockMiddleware_WrapCallback_Call[I, O]
type MockMiddleware_WrapDestination_Call ¶
MockMiddleware_WrapDestination_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WrapDestination'
func (*MockMiddleware_WrapDestination_Call[I, O]) Return ¶
func (_c *MockMiddleware_WrapDestination_Call[I, O]) Return(destination1 Destination[O], err error) *MockMiddleware_WrapDestination_Call[I, O]
func (*MockMiddleware_WrapDestination_Call[I, O]) Run ¶
func (_c *MockMiddleware_WrapDestination_Call[I, O]) Run(run func(ctx context.Context, rule Rule, destination Destination[O])) *MockMiddleware_WrapDestination_Call[I, O]
func (*MockMiddleware_WrapDestination_Call[I, O]) RunAndReturn ¶
func (_c *MockMiddleware_WrapDestination_Call[I, O]) RunAndReturn(run func(ctx context.Context, rule Rule, destination Destination[O]) (Destination[O], error)) *MockMiddleware_WrapDestination_Call[I, O]
type MockReducer ¶
MockReducer is an autogenerated mock type for the Reducer type
func NewMockReducer ¶
func NewMockReducer[M any, Out any](t interface { mock.TestingT Cleanup(func()) }) *MockReducer[M, Out]
NewMockReducer creates a new instance of MockReducer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockReducer[M, Out]) EXPECT ¶
func (_m *MockReducer[M, Out]) EXPECT() *MockReducer_Expecter[M, Out]
type MockReducer_Expecter ¶
func (*MockReducer_Expecter[M, Out]) Reduce ¶
func (_e *MockReducer_Expecter[M, Out]) Reduce(ctx any, intermediary any, accumulator any) *MockReducer_Reduce_Call[M, Out]
Reduce is a helper method to define mock.On call
- ctx context.Context
- intermediary M
- accumulator Out
type MockReducer_Reduce_Call ¶
MockReducer_Reduce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reduce'
func (*MockReducer_Reduce_Call[M, Out]) Return ¶
func (_c *MockReducer_Reduce_Call[M, Out]) Return(v Out, err error) *MockReducer_Reduce_Call[M, Out]
func (*MockReducer_Reduce_Call[M, Out]) Run ¶
func (_c *MockReducer_Reduce_Call[M, Out]) Run(run func(ctx context.Context, intermediary M, accumulator Out)) *MockReducer_Reduce_Call[M, Out]
func (*MockReducer_Reduce_Call[M, Out]) RunAndReturn ¶
func (_c *MockReducer_Reduce_Call[M, Out]) RunAndReturn(run func(ctx context.Context, intermediary M, accumulator Out) (Out, error)) *MockReducer_Reduce_Call[M, Out]
type MockRule ¶
MockRule is an autogenerated mock type for the Rule type
func NewMockRule ¶
NewMockRule creates a new instance of MockRule. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockRule) EXPECT ¶
func (_m *MockRule) EXPECT() *MockRule_Expecter
func (*MockRule) GetEnvironments ¶
GetEnvironments provides a mock function for the type MockRule
func (*MockRule) GetNextSameSource ¶
GetNextSameSource provides a mock function for the type MockRule
func (*MockRule) SetNextSameSource ¶
SetNextSameSource provides a mock function for the type MockRule
func (*MockRule) SetPrevSameSource ¶
SetPrevSameSource provides a mock function for the type MockRule
type MockRule_Expecter ¶
type MockRule_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRule_Expecter) GetEnvironments ¶
func (_e *MockRule_Expecter) GetEnvironments() *MockRule_GetEnvironments_Call
GetEnvironments is a helper method to define mock.On call
func (*MockRule_Expecter) GetID ¶
func (_e *MockRule_Expecter) GetID() *MockRule_GetID_Call
GetID is a helper method to define mock.On call
func (*MockRule_Expecter) GetNext ¶
func (_e *MockRule_Expecter) GetNext() *MockRule_GetNext_Call
GetNext is a helper method to define mock.On call
func (*MockRule_Expecter) GetNextSameSource ¶
func (_e *MockRule_Expecter) GetNextSameSource() *MockRule_GetNextSameSource_Call
GetNextSameSource is a helper method to define mock.On call
func (*MockRule_Expecter) GetPrev ¶
func (_e *MockRule_Expecter) GetPrev() *MockRule_GetPrev_Call
GetPrev is a helper method to define mock.On call
func (*MockRule_Expecter) GetSource ¶
func (_e *MockRule_Expecter) GetSource() *MockRule_GetSource_Call
GetSource is a helper method to define mock.On call
func (*MockRule_Expecter) Init ¶
func (_e *MockRule_Expecter) Init(ctx any) *MockRule_Init_Call
Init is a helper method to define mock.On call
- ctx context.Context
func (*MockRule_Expecter) SetNext ¶
func (_e *MockRule_Expecter) SetNext(n any) *MockRule_SetNext_Call
SetNext is a helper method to define mock.On call
- n Rule
func (*MockRule_Expecter) SetNextSameSource ¶
func (_e *MockRule_Expecter) SetNextSameSource(n any) *MockRule_SetNextSameSource_Call
SetNextSameSource is a helper method to define mock.On call
- n Rule
func (*MockRule_Expecter) SetPrev ¶
func (_e *MockRule_Expecter) SetPrev(p any) *MockRule_SetPrev_Call
SetPrev is a helper method to define mock.On call
- p Rule
func (*MockRule_Expecter) SetPrevSameSource ¶
func (_e *MockRule_Expecter) SetPrevSameSource(p any) *MockRule_SetPrevSameSource_Call
SetPrevSameSource is a helper method to define mock.On call
- p Rule
func (*MockRule_Expecter) Start ¶
func (_e *MockRule_Expecter) Start(ctx any) *MockRule_Start_Call
Start is a helper method to define mock.On call
- ctx context.Context
type MockRule_GetEnvironments_Call ¶
MockRule_GetEnvironments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEnvironments'
func (*MockRule_GetEnvironments_Call) Return ¶
func (_c *MockRule_GetEnvironments_Call) Return(strings []string) *MockRule_GetEnvironments_Call
func (*MockRule_GetEnvironments_Call) Run ¶
func (_c *MockRule_GetEnvironments_Call) Run(run func()) *MockRule_GetEnvironments_Call
func (*MockRule_GetEnvironments_Call) RunAndReturn ¶
func (_c *MockRule_GetEnvironments_Call) RunAndReturn(run func() []string) *MockRule_GetEnvironments_Call
type MockRule_GetID_Call ¶
MockRule_GetID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetID'
func (*MockRule_GetID_Call) Return ¶
func (_c *MockRule_GetID_Call) Return(s string) *MockRule_GetID_Call
func (*MockRule_GetID_Call) Run ¶
func (_c *MockRule_GetID_Call) Run(run func()) *MockRule_GetID_Call
func (*MockRule_GetID_Call) RunAndReturn ¶
func (_c *MockRule_GetID_Call) RunAndReturn(run func() string) *MockRule_GetID_Call
type MockRule_GetNextSameSource_Call ¶
MockRule_GetNextSameSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextSameSource'
func (*MockRule_GetNextSameSource_Call) Return ¶
func (_c *MockRule_GetNextSameSource_Call) Return(rule Rule) *MockRule_GetNextSameSource_Call
func (*MockRule_GetNextSameSource_Call) Run ¶
func (_c *MockRule_GetNextSameSource_Call) Run(run func()) *MockRule_GetNextSameSource_Call
func (*MockRule_GetNextSameSource_Call) RunAndReturn ¶
func (_c *MockRule_GetNextSameSource_Call) RunAndReturn(run func() Rule) *MockRule_GetNextSameSource_Call
type MockRule_GetNext_Call ¶
MockRule_GetNext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNext'
func (*MockRule_GetNext_Call) Return ¶
func (_c *MockRule_GetNext_Call) Return(rule Rule) *MockRule_GetNext_Call
func (*MockRule_GetNext_Call) Run ¶
func (_c *MockRule_GetNext_Call) Run(run func()) *MockRule_GetNext_Call
func (*MockRule_GetNext_Call) RunAndReturn ¶
func (_c *MockRule_GetNext_Call) RunAndReturn(run func() Rule) *MockRule_GetNext_Call
type MockRule_GetPrev_Call ¶
MockRule_GetPrev_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrev'
func (*MockRule_GetPrev_Call) Return ¶
func (_c *MockRule_GetPrev_Call) Return(rule Rule) *MockRule_GetPrev_Call
func (*MockRule_GetPrev_Call) Run ¶
func (_c *MockRule_GetPrev_Call) Run(run func()) *MockRule_GetPrev_Call
func (*MockRule_GetPrev_Call) RunAndReturn ¶
func (_c *MockRule_GetPrev_Call) RunAndReturn(run func() Rule) *MockRule_GetPrev_Call
type MockRule_GetSource_Call ¶
MockRule_GetSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSource'
func (*MockRule_GetSource_Call) Return ¶
func (_c *MockRule_GetSource_Call) Return(v any) *MockRule_GetSource_Call
func (*MockRule_GetSource_Call) Run ¶
func (_c *MockRule_GetSource_Call) Run(run func()) *MockRule_GetSource_Call
func (*MockRule_GetSource_Call) RunAndReturn ¶
func (_c *MockRule_GetSource_Call) RunAndReturn(run func() any) *MockRule_GetSource_Call
type MockRule_Init_Call ¶
MockRule_Init_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Init'
func (*MockRule_Init_Call) Return ¶
func (_c *MockRule_Init_Call) Return(err error) *MockRule_Init_Call
func (*MockRule_Init_Call) Run ¶
func (_c *MockRule_Init_Call) Run(run func(ctx context.Context)) *MockRule_Init_Call
func (*MockRule_Init_Call) RunAndReturn ¶
func (_c *MockRule_Init_Call) RunAndReturn(run func(ctx context.Context) error) *MockRule_Init_Call
type MockRule_SetNextSameSource_Call ¶
MockRule_SetNextSameSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNextSameSource'
func (*MockRule_SetNextSameSource_Call) Return ¶
func (_c *MockRule_SetNextSameSource_Call) Return() *MockRule_SetNextSameSource_Call
func (*MockRule_SetNextSameSource_Call) Run ¶
func (_c *MockRule_SetNextSameSource_Call) Run(run func(n Rule)) *MockRule_SetNextSameSource_Call
func (*MockRule_SetNextSameSource_Call) RunAndReturn ¶
func (_c *MockRule_SetNextSameSource_Call) RunAndReturn(run func(n Rule)) *MockRule_SetNextSameSource_Call
type MockRule_SetNext_Call ¶
MockRule_SetNext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetNext'
func (*MockRule_SetNext_Call) Return ¶
func (_c *MockRule_SetNext_Call) Return() *MockRule_SetNext_Call
func (*MockRule_SetNext_Call) Run ¶
func (_c *MockRule_SetNext_Call) Run(run func(n Rule)) *MockRule_SetNext_Call
func (*MockRule_SetNext_Call) RunAndReturn ¶
func (_c *MockRule_SetNext_Call) RunAndReturn(run func(n Rule)) *MockRule_SetNext_Call
type MockRule_SetPrevSameSource_Call ¶
MockRule_SetPrevSameSource_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPrevSameSource'
func (*MockRule_SetPrevSameSource_Call) Return ¶
func (_c *MockRule_SetPrevSameSource_Call) Return() *MockRule_SetPrevSameSource_Call
func (*MockRule_SetPrevSameSource_Call) Run ¶
func (_c *MockRule_SetPrevSameSource_Call) Run(run func(p Rule)) *MockRule_SetPrevSameSource_Call
func (*MockRule_SetPrevSameSource_Call) RunAndReturn ¶
func (_c *MockRule_SetPrevSameSource_Call) RunAndReturn(run func(p Rule)) *MockRule_SetPrevSameSource_Call
type MockRule_SetPrev_Call ¶
MockRule_SetPrev_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPrev'
func (*MockRule_SetPrev_Call) Return ¶
func (_c *MockRule_SetPrev_Call) Return() *MockRule_SetPrev_Call
func (*MockRule_SetPrev_Call) Run ¶
func (_c *MockRule_SetPrev_Call) Run(run func(p Rule)) *MockRule_SetPrev_Call
func (*MockRule_SetPrev_Call) RunAndReturn ¶
func (_c *MockRule_SetPrev_Call) RunAndReturn(run func(p Rule)) *MockRule_SetPrev_Call
type MockRule_Start_Call ¶
MockRule_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*MockRule_Start_Call) Return ¶
func (_c *MockRule_Start_Call) Return(valCh <-chan struct{}, err error) *MockRule_Start_Call
func (*MockRule_Start_Call) Run ¶
func (_c *MockRule_Start_Call) Run(run func(ctx context.Context)) *MockRule_Start_Call
func (*MockRule_Start_Call) RunAndReturn ¶
func (_c *MockRule_Start_Call) RunAndReturn(run func(ctx context.Context) (<-chan struct{}, error)) *MockRule_Start_Call
type MockRunnable ¶
MockRunnable is an autogenerated mock type for the Runnable type
func NewMockRunnable ¶
func NewMockRunnable[I any](t interface { mock.TestingT Cleanup(func()) }) *MockRunnable[I]
NewMockRunnable creates a new instance of MockRunnable. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockRunnable[I]) EXPECT ¶
func (_m *MockRunnable[I]) EXPECT() *MockRunnable_Expecter[I]
func (*MockRunnable[I]) NextRunnable ¶
func (_mock *MockRunnable[I]) NextRunnable() Runnable[I]
NextRunnable provides a mock function for the type MockRunnable
type MockRunnable_Expecter ¶
type MockRunnable_Expecter[I any] struct { // contains filtered or unexported fields }
func (*MockRunnable_Expecter[I]) NextRunnable ¶
func (_e *MockRunnable_Expecter[I]) NextRunnable() *MockRunnable_NextRunnable_Call[I]
NextRunnable is a helper method to define mock.On call
func (*MockRunnable_Expecter[I]) Run ¶
func (_e *MockRunnable_Expecter[I]) Run(ctx any, event any, syms any) *MockRunnable_Run_Call[I]
Run is a helper method to define mock.On call
- ctx context.Context
- event I
- syms boolexpr.Symbols
type MockRunnable_NextRunnable_Call ¶
MockRunnable_NextRunnable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NextRunnable'
func (*MockRunnable_NextRunnable_Call[I]) Return ¶
func (_c *MockRunnable_NextRunnable_Call[I]) Return(runnable Runnable[I]) *MockRunnable_NextRunnable_Call[I]
func (*MockRunnable_NextRunnable_Call[I]) Run ¶
func (_c *MockRunnable_NextRunnable_Call[I]) Run(run func()) *MockRunnable_NextRunnable_Call[I]
func (*MockRunnable_NextRunnable_Call[I]) RunAndReturn ¶
func (_c *MockRunnable_NextRunnable_Call[I]) RunAndReturn(run func() Runnable[I]) *MockRunnable_NextRunnable_Call[I]
type MockRunnable_Run_Call ¶
MockRunnable_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'
func (*MockRunnable_Run_Call[I]) Return ¶
func (_c *MockRunnable_Run_Call[I]) Return(err error) *MockRunnable_Run_Call[I]
func (*MockRunnable_Run_Call[I]) Run ¶
func (_c *MockRunnable_Run_Call[I]) Run(run func(ctx context.Context, event I, syms boolexpr.Symbols)) *MockRunnable_Run_Call[I]
func (*MockRunnable_Run_Call[I]) RunAndReturn ¶
func (_c *MockRunnable_Run_Call[I]) RunAndReturn(run func(ctx context.Context, event I, syms boolexpr.Symbols) error) *MockRunnable_Run_Call[I]
type MockSource ¶
MockSource is an autogenerated mock type for the Source type
func NewMockSource ¶
func NewMockSource[T any](t interface { mock.TestingT Cleanup(func()) }) *MockSource[T]
NewMockSource creates a new instance of MockSource. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockSource[T]) EXPECT ¶
func (_m *MockSource[T]) EXPECT() *MockSource_Expecter[T]
type MockSource_Expecter ¶
type MockSource_Expecter[T any] struct { // contains filtered or unexported fields }
func (*MockSource_Expecter[T]) Start ¶
func (_e *MockSource_Expecter[T]) Start(ctx any, cb any) *MockSource_Start_Call[T]
Start is a helper method to define mock.On call
- ctx context.Context
- cb Callback[T]
type MockSource_Start_Call ¶
MockSource_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
func (*MockSource_Start_Call[T]) Return ¶
func (_c *MockSource_Start_Call[T]) Return(done <-chan struct{}, err error) *MockSource_Start_Call[T]
func (*MockSource_Start_Call[T]) Run ¶
func (_c *MockSource_Start_Call[T]) Run(run func(ctx context.Context, cb Callback[T])) *MockSource_Start_Call[T]
func (*MockSource_Start_Call[T]) RunAndReturn ¶
func (_c *MockSource_Start_Call[T]) RunAndReturn(run func(ctx context.Context, cb Callback[T]) (<-chan struct{}, error)) *MockSource_Start_Call[T]
type ReduceError ¶
type ReduceError struct{ Err error }
ReduceError wraps an error returned by Reducer.Reduce.
func (ReduceError) Error ¶
func (e ReduceError) Error() string
func (ReduceError) Unwrap ¶
func (e ReduceError) Unwrap() error
type Reducer ¶
type Reducer[M, Out any] interface { Reduce(ctx context.Context, intermediary M, accumulator Out) (Out, error) }
Reducer combines an intermediary value with an accumulator to produce a new output value. Used by MapReduceRule to reduce mapped events into a running result.
type Rule ¶
type Rule interface {
GetNext() Rule
SetNext(n Rule)
GetPrev() Rule
SetPrev(p Rule)
GetSource() any
Start(ctx context.Context) (<-chan struct{}, error)
SetNextSameSource(n Rule)
SetPrevSameSource(p Rule)
GetNextSameSource() Rule
GetID() string
GetEnvironments() []string
Init(ctx context.Context) error
}
Rule handler that accumulates rules and manages their execution.
type Runnable ¶
type Runnable[I any] interface { Run(ctx context.Context, event I, syms boolexpr.Symbols) error NextRunnable() Runnable[I] }
Runnable represents a rule that can be executed to process events.
type SQLRule ¶
type SQLRule[I, O any] struct { // ID is a unique identifier for the rule, used for reporting and debugging purposes. ID string `validate:"required"` // Environments is a list of environment names where the rule is active. If // empty, the rule is active in all environments. Environments []string // Select is the action to process input events into output events. Select Action[I, O] `validate:"required"` // From is the source that produces events to be processed by this rule. From Source[I] `validate:"required"` // Where is a condition that must evaluate to true for the rule to process the event. // Use condition.Cond for string expressions, condition.RateLimit for rate limiting, // condition.Once for deduplication, or condition.Conditions for combining multiple conditions. Where Condition[I] // Having is a condition that must evaluate to true for the rule to send // the output of the Select action to the Into destination. Having Condition[O] // Into is the destination to send the output of the Select action. Into Destination[O] `validate:"required"` // Middlewares are the middlewares that will be applied to the action and // destination and callback of the rule. The first middleware wraps the // second middleware, and so on. The last middleware wraps the // actions/destination/callback of the rule. Middlewares []Middleware[I, O] // contains filtered or unexported fields }
SQLRule defines an event processing pipeline from source to destination. I and O represent the input and output event types.
func (*SQLRule[I, O]) GetEnvironments ¶
GetEnvironments returns the list of environments where the rule is active.
func (*SQLRule[I, O]) GetNextSameSource ¶
GetNextSameSource returns the next rule sharing the same source.
func (*SQLRule[I, O]) Init ¶
Init initializes the rule by wrapping the callback, action, and destination with the configured middlewares. Middlewares are applied in reverse order, so the first middleware in the slice wraps all subsequent ones.
func (*SQLRule[I, O]) NextRunnable ¶
NextRunnable returns the next runnable rule with the same source.
func (*SQLRule[I, O]) SetNextSameSource ¶
SetNextSameSource sets the next rule sharing the same source.
func (*SQLRule[I, O]) SetPrevSameSource ¶
SetPrevSameSource sets the previous rule sharing the same source.
type ScenarioRule ¶
type ScenarioRule[I, O any] struct { // ID is a unique identifier for the rule, used for reporting and // debugging purposes. ID string `validate:"required"` // Environments is a list of environment names where the rule is active. // If empty, the rule is active in all environments. Environments []string // When is the source that produces events to be processed by this rule. When Source[I] `validate:"required"` // Given is a condition that must evaluate to true for the rule to process // the event. Given Condition[I] // Then is the action to process input events into output events. Then Action[I, O] `validate:"required"` // GivenOutput is a condition that must evaluate to true for the rule to // send the output of the Then action to the To destination. GivenOutput Condition[O] // To is the destination to send the output of the Then action. To Destination[O] `validate:"required"` // Middlewares are the middlewares that will be applied to the action and // destination and callback of the rule. The first middleware wraps the // second middleware, and so on. The last middleware wraps the // actions/destination/callback of the rule. Middlewares []Middleware[I, O] // contains filtered or unexported fields }
ScenarioRule defines an event processing pipeline following the BDD Given-When-Then pattern. I and O represent the input and output event types.
Pipeline: When (source) → Given (condition) → Then (action) →
GivenOutput (condition) → To (destination).
func (*ScenarioRule[I, O]) GetEnvironments ¶
func (r *ScenarioRule[I, O]) GetEnvironments() []string
GetEnvironments returns the list of environments where the rule is active.
func (*ScenarioRule[I, O]) GetID ¶
func (r *ScenarioRule[I, O]) GetID() string
GetID returns the unique identifier of the rule.
func (*ScenarioRule[I, O]) GetNext ¶
func (r *ScenarioRule[I, O]) GetNext() Rule
GetNext returns the next rule in the circular rule list.
func (*ScenarioRule[I, O]) GetNextSameSource ¶
func (r *ScenarioRule[I, O]) GetNextSameSource() Rule
GetNextSameSource returns the next rule sharing the same source.
func (*ScenarioRule[I, O]) GetPrev ¶
func (r *ScenarioRule[I, O]) GetPrev() Rule
GetPrev returns the previous rule in the circular rule list.
func (*ScenarioRule[I, O]) GetPrevSameSource ¶
func (r *ScenarioRule[I, O]) GetPrevSameSource() Rule
GetPrevSameSource returns the previous rule sharing the same source.
func (*ScenarioRule[I, O]) GetSource ¶
func (r *ScenarioRule[I, O]) GetSource() any
GetSource returns the source associated with this rule.
func (*ScenarioRule[I, O]) Init ¶
func (r *ScenarioRule[I, O]) Init(ctx context.Context) error
Init initializes the rule by wrapping the callback, action, and destination with the configured middlewares. Middlewares are applied in reverse order, so the first middleware in the slice wraps all subsequent ones.
func (*ScenarioRule[I, O]) NextRunnable ¶
func (r *ScenarioRule[I, O]) NextRunnable() Runnable[I]
NextRunnable returns the next runnable rule with the same source.
func (*ScenarioRule[I, O]) Run ¶
Run executes the rule's action and destination for the given event.
func (*ScenarioRule[I, O]) SetNext ¶
func (r *ScenarioRule[I, O]) SetNext(n Rule)
SetNext sets the next rule in the circular rule list.
func (*ScenarioRule[I, O]) SetNextSameSource ¶
func (r *ScenarioRule[I, O]) SetNextSameSource(n Rule)
SetNextSameSource sets the next rule sharing the same source.
func (*ScenarioRule[I, O]) SetPrev ¶
func (r *ScenarioRule[I, O]) SetPrev(p Rule)
SetPrev sets the previous rule in the circular rule list.
func (*ScenarioRule[I, O]) SetPrevSameSource ¶
func (r *ScenarioRule[I, O]) SetPrevSameSource(p Rule)
SetPrevSameSource sets the previous rule sharing the same source.
type Source ¶
type Source[T any] interface { Start(ctx context.Context, cb Callback[T]) (done <-chan struct{}, err error) }
Source produces events of type T.
type StreamRule ¶
type StreamRule[I, O any] struct { // ID is a unique identifier for the rule, used for reporting and // debugging purposes. ID string `validate:"required"` // Environments is a list of environment names where the rule is active. // If empty, the rule is active in all environments. Environments []string // Source is the source that produces events to be processed by this rule. Source Source[I] `validate:"required"` // Filter is a condition that must evaluate to true for the rule to process // the event. Filter Condition[I] // Map is the action to process input events into output events. Map Action[I, O] `validate:"required"` // FilterOutput is a condition that must evaluate to true for the rule to // send the output of the Map action to the Sink destination. FilterOutput Condition[O] // Sink is the destination to send the output of the Map action. Sink Destination[O] `validate:"required"` // Middlewares are the middlewares that will be applied to the action and // destination and callback of the rule. The first middleware wraps the // second middleware, and so on. The last middleware wraps the // actions/destination/callback of the rule. Middlewares []Middleware[I, O] // contains filtered or unexported fields }
StreamRule defines an event processing pipeline following the Kafka Streams pattern. I and O represent the input and output event types.
Pipeline: Source → Filter → Map → FilterOutput → Sink.
func (*StreamRule[I, O]) GetEnvironments ¶
func (r *StreamRule[I, O]) GetEnvironments() []string
GetEnvironments returns the list of environments where the rule is active.
func (*StreamRule[I, O]) GetID ¶
func (r *StreamRule[I, O]) GetID() string
GetID returns the unique identifier of the rule.
func (*StreamRule[I, O]) GetNext ¶
func (r *StreamRule[I, O]) GetNext() Rule
GetNext returns the next rule in the circular rule list.
func (*StreamRule[I, O]) GetNextSameSource ¶
func (r *StreamRule[I, O]) GetNextSameSource() Rule
GetNextSameSource returns the next rule sharing the same source.
func (*StreamRule[I, O]) GetPrev ¶
func (r *StreamRule[I, O]) GetPrev() Rule
GetPrev returns the previous rule in the circular rule list.
func (*StreamRule[I, O]) GetPrevSameSource ¶
func (r *StreamRule[I, O]) GetPrevSameSource() Rule
GetPrevSameSource returns the previous rule sharing the same source.
func (*StreamRule[I, O]) GetSource ¶
func (r *StreamRule[I, O]) GetSource() any
GetSource returns the source associated with this rule.
func (*StreamRule[I, O]) Init ¶
func (r *StreamRule[I, O]) Init(ctx context.Context) error
Init initializes the rule by wrapping the callback, action, and destination with the configured middlewares. Middlewares are applied in reverse order, so the first middleware in the slice wraps all subsequent ones.
func (*StreamRule[I, O]) NextRunnable ¶
func (r *StreamRule[I, O]) NextRunnable() Runnable[I]
NextRunnable returns the next runnable rule with the same source.
func (*StreamRule[I, O]) SetNext ¶
func (r *StreamRule[I, O]) SetNext(n Rule)
SetNext sets the next rule in the circular rule list.
func (*StreamRule[I, O]) SetNextSameSource ¶
func (r *StreamRule[I, O]) SetNextSameSource(n Rule)
SetNextSameSource sets the next rule sharing the same source.
func (*StreamRule[I, O]) SetPrev ¶
func (r *StreamRule[I, O]) SetPrev(p Rule)
SetPrev sets the previous rule in the circular rule list.
func (*StreamRule[I, O]) SetPrevSameSource ¶
func (r *StreamRule[I, O]) SetPrevSameSource(p Rule)
SetPrevSameSource sets the previous rule sharing the same source.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package actions provides reusable action implementations for firehose rules.
|
Package actions provides reusable action implementations for firehose rules. |
|
Package cache provides in-memory caching implementations for firehose middleware.
|
Package cache provides in-memory caching implementations for firehose middleware. |
|
Package condition provides condition implementations for rule evaluation.
|
Package condition provides condition implementations for rule evaluation. |
|
Package destinations provides reusable destination implementations for firehose rules.
|
Package destinations provides reusable destination implementations for firehose rules. |
|
Package middlewares provides reusable firehose middleware implementations.
|
Package middlewares provides reusable firehose middleware implementations. |
|
Package runner provides task runner implementations for executing functions concurrently.
|
Package runner provides task runner implementations for executing functions concurrently. |
|
Package sources provides reusable source implementations for firehose rules.
|
Package sources provides reusable source implementations for firehose rules. |