Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionExpression ¶
type BooleanOperator ¶
type BooleanOperator string
type ConditionExpression ¶
type CreateRuleRequest ¶
type Node ¶
type Node struct { Left *Node Right *Node BooleanOperator BooleanOperator Expression *ConditionExpression }
type Rule ¶
type Rule struct { Id int64 `json:"id"` Name string `json:"name"` When WhenExpression `json:"when"` Then ThenExpression `json:"then"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` // contains filtered or unexported fields }
func (*Rule) ReadAction ¶
func (rule *Rule) ReadAction() (*ActionExpression, error)
func (*Rule) ReadConditionAst ¶
type RulesController ¶
type RulesController struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(database RulesDatabase) *RulesController
func (*RulesController) ListRules ¶
func (controller *RulesController) ListRules(context *gin.Context)
func (*RulesController) PostRule ¶
func (controller *RulesController) PostRule(context *gin.Context)
type RulesDatabase ¶
type RulesDatabase interface { AddRule(rule *Rule) error ListRules() ([]Rule, error) GetSensor(deviceId, sensorId string) (*sensor.Sensor, error) GetCurrentSensorValue(deviceId, sensorId string) (*value.SensorValue, error) GetPreviousSensorValue(deviceId, sensorId string) (*value.SensorValue, error) GetCommand(deviceId, commandId string) (*command.Command, error) GetDevice(deviceId string) (*device.Device, error) }
type ThenExpression ¶
type ThenExpression string
type WhenExpression ¶
type WhenExpression string
Click to show internal directories.
Click to hide internal directories.