Documentation
¶
Index ¶
- func From(v *Validator) (err error)
- func Load(id string) error
- func LoadAll() error
- func Shutdown() error
- func Startup() error
- func Unload(id string) error
- type Alarm
- type Compare
- type Condition
- type Context
- type Validator
- func (v *Validator) Close() error
- func (v *Validator) OnDeviceValuesChange(product, device string, values map[string]any)
- func (v *Validator) OnProjectValuesChange(project, product, device string, values map[string]any)
- func (v *Validator) OnSpaceValuesChange(space, product, device string, values map[string]any)
- func (v *Validator) Open() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alarm ¶
type Alarm struct { Id primitive.ObjectID `json:"_id" bson:"_id"` ProjectId primitive.ObjectID `json:"project_id" bson:"project_id"` SpaceId primitive.ObjectID `json:"space_id" bson:"space_id"` ProductId primitive.ObjectID `json:"product_id" bson:"product_id"` DeviceId primitive.ObjectID `json:"device_id" bson:"device_id"` Level int `json:"level,omitempty"` //等级 1 2 3 Type string `json:"type,omitempty"` //类型: 遥测 遥信 等 Title string `json:"title,omitempty"` //标题 Message string `json:"message,omitempty"` //内容 Created time.Time `json:"created"` }
type Compare ¶
type Condition ¶
type Condition struct { //外or,内and Conditions [][]*Compare `json:"conditions,omitempty"` }
type Validator ¶
type Validator struct { Id string `json:"_id" bson:"_id"` ProjectId string `json:"project_id" bson:"project_id"` SpaceId string `json:"space_id" bson:"space_id"` ProductId string `json:"product_id" bson:"product_id"` DeviceId string `json:"device_id" bson:"device_id"` Condition //直接嵌入条件 Name string `json:"name"` Level int `json:"level,omitempty"` //等级 1 2 3 Type string `json:"type,omitempty"` //类型: 遥测 遥信 等 Title string `json:"title,omitempty"` //标题 Message string `json:"message,omitempty"` //内容 Disabled bool `json:"disabled"` Delay int64 `json:"delay,omitempty"` Repeat bool `json:"repeat,omitempty"` RepeatTimeout int64 `json:"repeat_timeout,omitempty" bson:"repeat_timeout,omitempty"` RepeatTimes int `json:"repeat_times,omitempty" bson:"repeat_times,omitempty"` // contains filtered or unexported fields }
func (*Validator) OnDeviceValuesChange ¶
func (*Validator) OnProjectValuesChange ¶
func (*Validator) OnSpaceValuesChange ¶
Click to show internal directories.
Click to hide internal directories.