Documentation ¶
Index ¶
- Variables
- func ParseStatefulFunctions(statefulFunctions []StatefulFunction, expression *expr.Expr) error
- type Builder
- type CompleteState
- type CompleteStateProvider
- type CompleteStatefulFunction
- type Number
- type OrderType
- type Rule
- type SequenceState
- type SequenceStateProvider
- type SequenceStatefulFunction
- type StateProvider
- func (sp *StateProvider) CompleteAddFloat64(v float64) bool
- func (sp *StateProvider) CompleteAddInt64(v int64) bool
- func (sp *StateProvider) CompleteAddUint64(v uint64) bool
- func (sp *StateProvider) SequenceAddFloat64(v float64) bool
- func (sp *StateProvider) SequenceAddInt64(v int64) bool
- func (sp *StateProvider) SequenceAddString(v string) bool
- func (sp *StateProvider) SequenceAddUint64(v uint64) bool
- func (sp *StateProvider) WithCompleteState(step float64) *StateProvider
- func (sp *StateProvider) WithSequenceState(order OrderType) *StateProvider
- type StatefulFunction
- type SupportedFunctions
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckFunctionsEnvOptions = []cel.EnvOption{ absDoubleFunc, absIntFunc, nowFunc, makeSequenceInt(nil), makeSequenceUint(nil), makeSequenceFloat64(nil), makeSequenceString(nil), makeCompleteInt(nil), makeCompleteUint(nil), makeCompleteFloat64(nil), }
CheckFunctionsEnvOptions contains all the custom functions used when defining check rules. Stateful functions added here are dummy functions that are overloaded on-demand with a correctly initialized state when a rule is created.
View Source
var StreamFunctionsEnvOptions = []cel.EnvOption{
absDoubleFunc,
absIntFunc,
nowFunc,
}
StreamFunctionsEnvOptions contains all the custom functions used when defining stream rules.
Functions ¶
func ParseStatefulFunctions ¶ added in v0.3.0
func ParseStatefulFunctions(statefulFunctions []StatefulFunction, expression *expr.Expr) error
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(schema sample.Schema, supportedFunctions SupportedFunctions) (*Builder, error)
type CompleteState ¶ added in v0.3.0
func NewCompleteState ¶ added in v0.3.0
func NewCompleteState[T Number](step T) *CompleteState[T]
func (*CompleteState[T]) Add ¶ added in v0.3.0
func (ss *CompleteState[T]) Add(value T) bool
type CompleteStateProvider ¶ added in v0.3.0
type CompleteStateProvider interface { CompleteAddInt64(int64) bool CompleteAddUint64(uint64) bool CompleteAddFloat64(float64) bool }
complete (stateful)
type CompleteStatefulFunction ¶ added in v0.3.0
type CompleteStatefulFunction struct { Step float64 // contains filtered or unexported fields }
func (*CompleteStatefulFunction) Enabled ¶ added in v0.3.0
func (csf *CompleteStatefulFunction) Enabled() bool
func (*CompleteStatefulFunction) GetCelEnvs ¶ added in v0.3.0
func (csf *CompleteStatefulFunction) GetCelEnvs(stateProvider *StateProvider) []cel.EnvOption
func (*CompleteStatefulFunction) GetName ¶ added in v0.3.0
func (csf *CompleteStatefulFunction) GetName() string
func (*CompleteStatefulFunction) ParseCallExpression ¶ added in v0.3.0
func (csf *CompleteStatefulFunction) ParseCallExpression(callExpression *expr.Expr_Call) error
type Number ¶ added in v0.3.0
type Number interface { constraints.Float | constraints.Integer }
CompleteState
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
func (*Rule) StateProvider ¶ added in v0.3.0
func (r *Rule) StateProvider() *StateProvider
type SequenceState ¶ added in v0.3.0
type SequenceState[T constraints.Ordered] struct { Order OrderType // contains filtered or unexported fields }
SequenceState
func NewSequenceState ¶ added in v0.3.0
func NewSequenceState[T constraints.Ordered](orderType OrderType) *SequenceState[T]
func (*SequenceState[T]) Add ¶ added in v0.3.0
func (ss *SequenceState[T]) Add(value T) bool
type SequenceStateProvider ¶ added in v0.3.0
type SequenceStateProvider interface { SequenceAddInt64(int64) bool SequenceAddUint64(uint64) bool SequenceAddFloat64(float64) bool SequenceAddString(string) bool }
sequence (stateful)
type SequenceStatefulFunction ¶ added in v0.3.0
type SequenceStatefulFunction struct { Order OrderType // contains filtered or unexported fields }
func (*SequenceStatefulFunction) Enabled ¶ added in v0.3.0
func (ssf *SequenceStatefulFunction) Enabled() bool
func (*SequenceStatefulFunction) GetCelEnvs ¶ added in v0.3.0
func (ssf *SequenceStatefulFunction) GetCelEnvs(stateProvider *StateProvider) []cel.EnvOption
func (*SequenceStatefulFunction) GetName ¶ added in v0.3.0
func (ssf *SequenceStatefulFunction) GetName() string
func (*SequenceStatefulFunction) ParseCallExpression ¶ added in v0.3.0
func (ssf *SequenceStatefulFunction) ParseCallExpression(callExpression *expr.Expr_Call) error
type StateProvider ¶ added in v0.3.0
type StateProvider struct { // Sequence state SequenceEnabled bool // Complete state CompleteEnabled bool // contains filtered or unexported fields }
StateProvider
func NewStateProvider ¶ added in v0.3.0
func NewStateProvider() *StateProvider
func (*StateProvider) CompleteAddFloat64 ¶ added in v0.3.0
func (sp *StateProvider) CompleteAddFloat64(v float64) bool
func (*StateProvider) CompleteAddInt64 ¶ added in v0.3.0
func (sp *StateProvider) CompleteAddInt64(v int64) bool
func (*StateProvider) CompleteAddUint64 ¶ added in v0.3.0
func (sp *StateProvider) CompleteAddUint64(v uint64) bool
func (*StateProvider) SequenceAddFloat64 ¶ added in v0.3.0
func (sp *StateProvider) SequenceAddFloat64(v float64) bool
func (*StateProvider) SequenceAddInt64 ¶ added in v0.3.0
func (sp *StateProvider) SequenceAddInt64(v int64) bool
func (*StateProvider) SequenceAddString ¶ added in v0.3.0
func (sp *StateProvider) SequenceAddString(v string) bool
func (*StateProvider) SequenceAddUint64 ¶ added in v0.3.0
func (sp *StateProvider) SequenceAddUint64(v uint64) bool
func (*StateProvider) WithCompleteState ¶ added in v0.3.0
func (sp *StateProvider) WithCompleteState(step float64) *StateProvider
func (*StateProvider) WithSequenceState ¶ added in v0.3.0
func (sp *StateProvider) WithSequenceState(order OrderType) *StateProvider
type StatefulFunction ¶ added in v0.3.0
type SupportedFunctions ¶ added in v0.3.0
type SupportedFunctions int
const ( StreamFunctions SupportedFunctions = iota CheckFunctions )
Click to show internal directories.
Click to hide internal directories.