loader

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSystemDefaultRules

func LoadSystemDefaultRules(dir string) (map[string]*DeviceModelRules, error)

LoadSystemDefaultRules loads YAML files from brand/model directory structure These are system default rules that apply to all devices of a specific brand/model

Types

type DeviceModelRules

type DeviceModelRules struct {
	Brand       string     `yaml:"brand"`    // e.g., "rakwireless"
	Model       string     `yaml:"model"`    // e.g., "rak4630"
	ModelID     string     `yaml:"model_id"` // Resolved from device service
	DisplayName string     `yaml:"display_name"`
	Rules       []YAMLRule `yaml:"rules"`
}

DeviceModelRules represents event rules for a specific device model

type YAMLRule

type YAMLRule struct {
	RuleKey         string `yaml:"rule_key"`
	EntityIDPattern string `yaml:"entity_id_pattern"`
	Operator        string `yaml:"operator"`
	Operand         string `yaml:"operand"`
	EventType       string `yaml:"event_type"`
	EventLevel      string `yaml:"event_level"`
	Description     string `yaml:"description"`
	IsActive        bool   `yaml:"is_active"`
	RepeatAble      bool   `yaml:"repeat_able"`
}

YAMLRule represents a single event rule from YAML configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL