Documentation
¶
Index ¶
- func Compare(x, y interface{}, operator string) (bool, error)
- func New() chik.Handler
- func StringInterfaceToStateQuery(sourceType, targetType reflect.Type, sourceData interface{}) (interface{}, error)
- type Action
- type ActionCommand
- type MixedQuery
- type QueryResult
- type State
- type StateQueries
- type StateQuery
- type StructQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct {
ID string `json:"id"`
Query StateQueries `json:"query,omitempty"`
Perform []*types.Command `json:"perform,omitempty"`
}
Action is composed of a list of Queries and a Command to perform in case the AND composition of queries returns true
type ActionCommand ¶ added in v1.6.0
type MixedQuery ¶
type MixedQuery struct {
Var1 string `json:"var1"`
Op string `json:"op"`
Const interface{} `json:"const"`
Detrigger bool `json:"disable_trigger_on_change,omitempty"`
}
MixedQuery compares an element of State.Current with a constant only if that element is different from the same in State.Previous
func (*MixedQuery) Execute ¶
func (q *MixedQuery) Execute(state *State) (res QueryResult, err error)
type QueryResult ¶ added in v1.4.0
type QueryResult struct {
// contains filtered or unexported fields
}
type State ¶
type State struct {
Current map[string]interface{} `json:"current"`
Previous map[string]interface{} `json:"previous"`
// contains filtered or unexported fields
}
func CreateState ¶ added in v1.8.0
func (*State) GetFieldDescriptor ¶ added in v1.4.0
type StateQueries ¶ added in v1.6.0
type StateQueries []StateQuery
func (*StateQueries) UnmarshalJSON ¶ added in v1.6.0
func (sq *StateQueries) UnmarshalJSON(data []byte) error
type StateQuery ¶
type StateQuery interface {
Execute(state *State) (QueryResult, error)
}
type StructQuery ¶
type StructQuery struct {
Var1 string `json:"var1"`
Op string `json:"op"`
Var2 string `json:"var2"`
Detrigger bool `json:"disable_trigger_on_change,omitempty"`
}
StructQuery compares two elements of the State oin every state change
func (*StructQuery) Execute ¶
func (q *StructQuery) Execute(state *State) (res QueryResult, err error)
Click to show internal directories.
Click to hide internal directories.