preset

package
v0.0.0-...-7495956 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2019 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisablePreset

func DisablePreset(fileName string) error

* Disables preset by removing link file from EnabledPresetPath

func EnablePreset

func EnablePreset(fileName string) error

* Enables preset by creating a link from the AvailablePresetPath to the EnabledPresetPath

func GetAvailablePresets

func GetAvailablePresets() []string

* Gets available preset file names from AvailablePresetPath

Types

type Preset

type Preset struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Events      []struct {
		Name        string `json:"name"`
		Description string `json:"description"`
		PollingTime int64  `json:"pollingTime"`
		Conditions  []struct {
			Id          int               `json:"id"`
			Description string            `json:"description"`
			Function    function.Function `json:"function"`
			ExpectedVal interface{}       `json:"expected_val"`
		} `json:"conditions"`
		ConditionExp string `json:"condition_exp"`
	} `json:"events"`
	Reactions []struct {
		Name     string            `json:"name"`
		Function function.Function `json:"function"`
	} `json:"reactions"`
}

func LoadActivePresets

func LoadActivePresets() []Preset

* Loads active preset files from EnabledPresetPath directory

func LoadPreset

func LoadPreset(filePath string) Preset

* Returns Preset struct from json file

Jump to

Keyboard shortcuts

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