Documentation ¶
Index ¶
- Constants
- type Cell
- func (cell *Cell) DevName() string
- func (cell *Cell) IsButton() bool
- func (cell *Cell) IsComplete() bool
- func (cell *Cell) IsFreshButton() bool
- func (cell *Cell) Max() float64
- func (cell *Cell) Name() string
- func (cell *Cell) RawValue() string
- func (cell *Cell) SetValue(value interface{})
- func (cell *Cell) Type() string
- func (cell *Cell) Value() interface{}
- type CellChangedRuleCondition
- type CellModel
- func (model *CellModel) AcquireCellChangeChannel() chan *CellSpec
- func (model *CellModel) AddExternalDevice(name string) (wbgo.ExternalDeviceModel, error)
- func (model *CellModel) CallSync(thunk func())
- func (model *CellModel) EnsureCell(cellSpec *CellSpec) *Cell
- func (model *CellModel) EnsureDevice(name string) (dev CellModelDevice)
- func (model *CellModel) EnsureLocalDevice(name, title string) *CellModelLocalDevice
- func (model *CellModel) MustGetCell(cellSpec *CellSpec) *Cell
- func (model *CellModel) MustGetDevice(name string) (dev CellModelDevice)
- func (model *CellModel) ReleaseCellChangeChannel(ch chan *CellSpec)
- func (model *CellModel) RemoveLocalDevice(name string)
- func (model *CellModel) Start() error
- func (model *CellModel) Stop()
- func (model *CellModel) WhenReady(thunk func())
- type CellModelDevice
- type CellModelDeviceBase
- func (dev *CellModelDeviceBase) AcceptValue(name, value string)
- func (dev *CellModelDeviceBase) EnsureCell(name string) (cell *Cell)
- func (dev *CellModelDeviceBase) MustGetCell(name string) (cell *Cell)
- func (dev *CellModelDeviceBase) SetButtonCell(name string) (cell *Cell)
- func (dev *CellModelDeviceBase) SetCell(name, controlType string, value interface{}, readonly bool) (cell *Cell)
- func (dev *CellModelDeviceBase) SetRangeCell(name string, value interface{}, max float64, readonly bool) (cell *Cell)
- func (dev *CellModelDeviceBase) SetTitle(title string)
- type CellModelExternalDevice
- type CellModelLocalDevice
- type CellNotFoundError
- type CellProxy
- type CellSpec
- type CellType
- type CleanupFunc
- type CommandResult
- type Cron
- type CronRuleCondition
- type DepTracker
- type DestroyedRuleCondition
- type DeviceProxy
- type ESCallback
- type ESCallbackErrorHandler
- type ESCallbackFunc
- type ESContext
- func (ctx *ESContext) DefaultCallbackErrorHandler(err ESError)
- func (ctx *ESContext) DefineFunctions(fns map[string]func() int)
- func (ctx *ESContext) EvalScript(code string) error
- func (ctx *ESContext) Format() string
- func (ctx *ESContext) GetESError() (r ESError)
- func (ctx *ESContext) GetESErrorAugmentingSyntaxErrors(path string) (r ESError)
- func (ctx *ESContext) GetJSObject(objIndex int) interface{}
- func (ctx *ESContext) GetTraceback() ESTraceback
- func (ctx *ESContext) LoadAndCallFunctionFromString(filename, content string) error
- func (ctx *ESContext) LoadScenario(path string) error
- func (ctx *ESContext) LoadScript(path string) error
- func (ctx *ESContext) LoadScriptFromString(filename, content string) error
- func (ctx *ESContext) PushJSObject(obj interface{})
- func (ctx *ESContext) RemoveCallback(key ESCallback)
- func (ctx *ESContext) SetCallbackErrorHandler(handler ESCallbackErrorHandler)
- func (ctx *ESContext) StringArrayToGo(arrIndex int) []string
- func (ctx *ESContext) WrapCallback(callbackStackIndex int) ESCallbackFunc
- type ESEngine
- func (engine *ESEngine) ClosePersistentDB() (err error)
- func (engine *ESEngine) EvalScript(code string) error
- func (engine *ESEngine) ListSourceFiles() (entries []LocFileEntry, err error)
- func (engine *ESEngine) LiveLoadFile(path string) error
- func (engine *ESEngine) LiveRemoveFile(path string) error
- func (engine *ESEngine) LiveWriteScript(virtualPath, content string) error
- func (engine *ESEngine) LoadFile(path string) (err error)
- func (engine *ESEngine) ModSearch(ctx *duktape.Context) int
- func (engine *ESEngine) ScriptDir() string
- func (engine *ESEngine) SetPersistentDB(filename string) error
- func (engine *ESEngine) SetPersistentDBMode(filename string, mode os.FileMode) (err error)
- func (engine *ESEngine) SetSourceRoot(sourceRoot string) (err error)
- type ESEngineOptions
- type ESError
- type ESLocation
- type ESSyncFunc
- type ESTraceback
- type EdgeTriggeredRuleCondition
- type Editor
- func (editor *Editor) List(args *struct{}, reply *[]LocFileEntry) (err error)
- func (editor *Editor) Load(args *EditorPathArgs, reply *EditorContentResponse) error
- func (editor *Editor) Remove(args *EditorPathArgs, reply *bool) error
- func (editor *Editor) Save(args *EditorSaveArgs, reply *EditorSaveResponse) error
- type EditorContentResponse
- type EditorError
- type EditorPathArgs
- type EditorSaveArgs
- type EditorSaveResponse
- type EngineLogLevel
- type FuncValueChangedRuleCondition
- type LevelTriggeredRuleCondition
- type LocFileEntry
- type LocFileManager
- type LocItem
- type OrRuleCondition
- type Rule
- type RuleCondition
- type RuleConditionBase
- type RuleEngine
- func (engine *RuleEngine) CellModel() *CellModel
- func (engine *RuleEngine) CheckTimer(timerName string) bool
- func (engine *RuleEngine) CloseVirtualCellsDB() (err error)
- func (engine *RuleEngine) DefineRule(rule *Rule)
- func (engine *RuleEngine) DefineVirtualDevice(name string, obj objx.Map) error
- func (engine *RuleEngine) GetDeviceProxy(name string) *DeviceProxy
- func (engine *RuleEngine) IsActive() bool
- func (engine *RuleEngine) Log(level EngineLogLevel, message string)
- func (engine *RuleEngine) Logf(level EngineLogLevel, format string, v ...interface{})
- func (engine *RuleEngine) Publish(topic, payload string, qos byte, retain bool)
- func (engine *RuleEngine) ReadyCh() <-chan struct{}
- func (engine *RuleEngine) Refresh()
- func (engine *RuleEngine) RunRules(cellSpec *CellSpec, timerName string)
- func (engine *RuleEngine) SetCronMaker(cronMaker func() Cron)
- func (engine *RuleEngine) SetTimerFunc(timerFunc TimerFunc)
- func (engine *RuleEngine) SetVirtualCellsDB(filename string) (err error)
- func (engine *RuleEngine) SetVirtualCellsDBMode(filename string, mode os.FileMode) (err error)
- func (engine *RuleEngine) Start()
- func (engine *RuleEngine) StartTimer(name string, callback func(), interval time.Duration, periodic bool) uint64
- func (engine *RuleEngine) StartTrackingDeps()
- func (engine *RuleEngine) StopTimerByIndex(n uint64)
- func (engine *RuleEngine) StopTimerByName(name string)
- func (engine *RuleEngine) StoreRuleCellSpec(rule *Rule, cellSpec *CellSpec)
- func (engine *RuleEngine) StoreRuleDeps(rule *Rule)
- type RuleEngineOptions
- type ScopedCleanup
- type ScriptError
- type SimpleCallbackCondition
- type TimerEntry
- type TimerFunc
Constants ¶
const ( CELL_CHANGE_SLICE_CAPACITY = 4 CELL_CHANGE_CLOSE_TIMEOUT_MS = 200 CELL_TYPE_TEXT = iota CELL_TYPE_BOOLEAN CELL_TYPE_FLOAT CELL_TYPE_BUTTON )
const ( // no iota here because these values may be used // by external software EDITOR_ERROR_INVALID_PATH = 1000 EDITOR_ERROR_LISTDIR = 1001 EDITOR_ERROR_WRITE = 1002 EDITOR_ERROR_FILE_NOT_FOUND = 1003 EDITOR_ERROR_REMOVE = 1004 EDITOR_ERROR_READ = 1005 )
const ( NO_TIMER_NAME = "" DEFAULT_CELL_MAX = 255.0 RULES_CAPACITY = 256 CELL_RULES_CAPACITY = 8 NO_CALLBACK = ESCallback(0) RULE_ENGINE_SETTINGS_DEV_NAME = "wbrules" RULE_DEBUG_CELL_NAME = "Rule debugging" VIRTUAL_CELLS_DB_CHMOD = 0640 ENGINE_LOG_DEBUG = EngineLogLevel(iota) ENGINE_LOG_INFO ENGINE_LOG_WARNING ENGINE_LOG_ERROR )
const ( LIB_FILE = "lib.js" LIB_SYS_PATH = "/usr/share/wb-rules-system/scripts" LIB_REL_PATH_1 = "scripts" LIB_REL_PATH_2 = "../scripts" MIN_INTERVAL_MS = 1 PERSISTENT_DB_CHMOD = 0640 SOURCE_ITEM_DEVICE = itemType(iota) SOURCE_ITEM_RULE )
const ( SCOPE_STACK_CAPACITY = 10 CLEANUP_LIST_CAPACITY = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func (*Cell) IsComplete ¶
func (*Cell) IsFreshButton ¶
IsFreshButton returns true if this cell corresponds to a button that didn't receive value yet.
type CellChangedRuleCondition ¶
type CellChangedRuleCondition struct { RuleConditionBase // contains filtered or unexported fields }
func NewCellChangedRuleCondition ¶
func NewCellChangedRuleCondition(cellSpec CellSpec) (*CellChangedRuleCondition, error)
func (*CellChangedRuleCondition) Check ¶
func (ruleCond *CellChangedRuleCondition) Check(cell *Cell) (bool, interface{})
func (*CellChangedRuleCondition) GetCells ¶
func (ruleCond *CellChangedRuleCondition) GetCells() []*CellSpec
type CellModel ¶
func NewCellModel ¶
func NewCellModel() *CellModel
func (*CellModel) AcquireCellChangeChannel ¶
func (*CellModel) AddExternalDevice ¶
func (model *CellModel) AddExternalDevice(name string) (wbgo.ExternalDeviceModel, error)
func (*CellModel) EnsureCell ¶
func (*CellModel) EnsureDevice ¶
func (model *CellModel) EnsureDevice(name string) (dev CellModelDevice)
func (*CellModel) EnsureLocalDevice ¶
func (model *CellModel) EnsureLocalDevice(name, title string) *CellModelLocalDevice
func (*CellModel) MustGetCell ¶
func (*CellModel) MustGetDevice ¶
func (model *CellModel) MustGetDevice(name string) (dev CellModelDevice)
func (*CellModel) ReleaseCellChangeChannel ¶
func (*CellModel) RemoveLocalDevice ¶
type CellModelDevice ¶
type CellModelDeviceBase ¶
type CellModelDeviceBase struct { wbgo.DeviceBase // contains filtered or unexported fields }
func (*CellModelDeviceBase) AcceptValue ¶
func (dev *CellModelDeviceBase) AcceptValue(name, value string)
func (*CellModelDeviceBase) EnsureCell ¶
func (dev *CellModelDeviceBase) EnsureCell(name string) (cell *Cell)
func (*CellModelDeviceBase) MustGetCell ¶
func (dev *CellModelDeviceBase) MustGetCell(name string) (cell *Cell)
func (*CellModelDeviceBase) SetButtonCell ¶
func (dev *CellModelDeviceBase) SetButtonCell(name string) (cell *Cell)
func (*CellModelDeviceBase) SetCell ¶
func (dev *CellModelDeviceBase) SetCell(name, controlType string, value interface{}, readonly bool) (cell *Cell)
func (*CellModelDeviceBase) SetRangeCell ¶
func (dev *CellModelDeviceBase) SetRangeCell(name string, value interface{}, max float64, readonly bool) (cell *Cell)
func (*CellModelDeviceBase) SetTitle ¶
func (dev *CellModelDeviceBase) SetTitle(title string)
type CellModelExternalDevice ¶
type CellModelExternalDevice struct {
CellModelDeviceBase
}
func (*CellModelExternalDevice) AcceptControlRange ¶
func (dev *CellModelExternalDevice) AcceptControlRange(name string, max float64)
func (*CellModelExternalDevice) AcceptControlType ¶
func (dev *CellModelExternalDevice) AcceptControlType(name, controlType string)
type CellModelLocalDevice ¶
type CellModelLocalDevice struct {
CellModelDeviceBase
}
func (*CellModelLocalDevice) AcceptOnValue ¶
func (dev *CellModelLocalDevice) AcceptOnValue(name, value string) bool
func (*CellModelLocalDevice) IsVirtual ¶
func (dev *CellModelLocalDevice) IsVirtual() bool
type CellNotFoundError ¶
type CellNotFoundError struct{}
"Cell not found" error
func (*CellNotFoundError) Error ¶
func (e *CellNotFoundError) Error() string
type CellProxy ¶
type CellProxy struct {
// contains filtered or unexported fields
}
CellProxy tracks cell access with the engine and makes sure that always the actual current device cell object is accessed while avoiding excess name lookups.
func (*CellProxy) IsComplete ¶
type CleanupFunc ¶
type CleanupFunc func()
type CommandResult ¶
type CronRuleCondition ¶
type CronRuleCondition struct { RuleConditionBase // contains filtered or unexported fields }
func NewCronRuleCondition ¶
func NewCronRuleCondition(spec string) *CronRuleCondition
func (*CronRuleCondition) MaybeAddToCron ¶
func (ruleCond *CronRuleCondition) MaybeAddToCron(cron Cron, thunk func()) (added bool, err error)
type DepTracker ¶
type DestroyedRuleCondition ¶
type DestroyedRuleCondition struct {
RuleConditionBase
}
func NewDestroyedRuleCondition ¶
func NewDestroyedRuleCondition() *DestroyedRuleCondition
func (*DestroyedRuleCondition) Check ¶
func (ruleCond *DestroyedRuleCondition) Check(cell *Cell) (bool, interface{})
type DeviceProxy ¶
type DeviceProxy struct {
// contains filtered or unexported fields
}
func (*DeviceProxy) EnsureCell ¶
func (devProxy *DeviceProxy) EnsureCell(name string) *CellProxy
type ESCallback ¶
type ESCallback uint64
type ESCallbackErrorHandler ¶
type ESCallbackErrorHandler func(err ESError)
type ESCallbackFunc ¶
type ESContext ¶
func (*ESContext) DefaultCallbackErrorHandler ¶
func (*ESContext) DefineFunctions ¶
func (*ESContext) EvalScript ¶
func (*ESContext) GetESError ¶
func (*ESContext) GetESErrorAugmentingSyntaxErrors ¶
func (*ESContext) GetJSObject ¶
func (*ESContext) GetTraceback ¶
func (ctx *ESContext) GetTraceback() ESTraceback
func (*ESContext) LoadAndCallFunctionFromString ¶
func (*ESContext) LoadScenario ¶
LoadScenario wraps loaded script into closure and gives extra global objects with additional information about environment
func (*ESContext) LoadScript ¶
func (*ESContext) LoadScriptFromString ¶
func (*ESContext) PushJSObject ¶
func (ctx *ESContext) PushJSObject(obj interface{})
func (*ESContext) RemoveCallback ¶
func (ctx *ESContext) RemoveCallback(key ESCallback)
func (*ESContext) SetCallbackErrorHandler ¶
func (ctx *ESContext) SetCallbackErrorHandler(handler ESCallbackErrorHandler)
func (*ESContext) StringArrayToGo ¶
func (*ESContext) WrapCallback ¶
func (ctx *ESContext) WrapCallback(callbackStackIndex int) ESCallbackFunc
type ESEngine ¶
type ESEngine struct { *RuleEngine // contains filtered or unexported fields }
func NewESEngine ¶
func NewESEngine(model *CellModel, mqttClient wbgo.MQTTClient, options *ESEngineOptions) (engine *ESEngine)
func (*ESEngine) ClosePersistentDB ¶
Force close DB
func (*ESEngine) EvalScript ¶
func (*ESEngine) ListSourceFiles ¶
func (engine *ESEngine) ListSourceFiles() (entries []LocFileEntry, err error)
func (*ESEngine) LiveLoadFile ¶
LiveLoadFile loads the specified script in the running engine. If the engine isn't ready yet, the function waits for it to become ready. If the script didn't change since the last time it was loaded, the script isn't loaded.
func (*ESEngine) LiveRemoveFile ¶
func (*ESEngine) LiveWriteScript ¶
func (*ESEngine) SetPersistentDB ¶
Create or open DB file
func (*ESEngine) SetPersistentDBMode ¶
func (*ESEngine) SetSourceRoot ¶
type ESEngineOptions ¶
type ESEngineOptions struct { *RuleEngineOptions PersistentDBFile string PersistentDBFileMode os.FileMode ScriptDirs []string }
func NewESEngineOptions ¶
func NewESEngineOptions() *ESEngineOptions
func (*ESEngineOptions) SetPersistentDBFile ¶
func (o *ESEngineOptions) SetPersistentDBFile(file string)
func (*ESEngineOptions) SetPersistentDBFileMode ¶
func (o *ESEngineOptions) SetPersistentDBFileMode(mode os.FileMode)
func (*ESEngineOptions) SetScriptDirs ¶
func (o *ESEngineOptions) SetScriptDirs(dirs []string)
type ESError ¶
type ESError struct { Message string Traceback ESTraceback }
type ESLocation ¶
type ESLocation struct {
// contains filtered or unexported fields
}
type ESSyncFunc ¶
type ESSyncFunc func(thunk func())
ESSyncFunc denotes a function that executes the specified thunk in the context of the goroutine which utilizes the context
type ESTraceback ¶
type ESTraceback []ESLocation
type EdgeTriggeredRuleCondition ¶
type EdgeTriggeredRuleCondition struct { SimpleCallbackCondition // contains filtered or unexported fields }
func NewEdgeTriggeredRuleCondition ¶
func NewEdgeTriggeredRuleCondition(cond func() bool) *EdgeTriggeredRuleCondition
func (*EdgeTriggeredRuleCondition) Check ¶
func (ruleCond *EdgeTriggeredRuleCondition) Check(cell *Cell) (bool, interface{})
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
func NewEditor ¶
func NewEditor(locFileManager LocFileManager) *Editor
func (*Editor) List ¶
func (editor *Editor) List(args *struct{}, reply *[]LocFileEntry) (err error)
func (*Editor) Load ¶
func (editor *Editor) Load(args *EditorPathArgs, reply *EditorContentResponse) error
func (*Editor) Save ¶
func (editor *Editor) Save(args *EditorSaveArgs, reply *EditorSaveResponse) error
type EditorContentResponse ¶
type EditorContentResponse struct { Content string `json:"content"` Error *ScriptError `json:"error,omitempty"` }
type EditorError ¶
type EditorError struct {
// contains filtered or unexported fields
}
func (*EditorError) Error ¶
func (err *EditorError) Error() string
func (*EditorError) ErrorCode ¶
func (err *EditorError) ErrorCode() int32
type EditorPathArgs ¶
type EditorPathArgs struct {
Path string `json:"path"`
}
type EditorSaveArgs ¶
type EditorSaveResponse ¶
type EngineLogLevel ¶
type EngineLogLevel int
type FuncValueChangedRuleCondition ¶
type FuncValueChangedRuleCondition struct { RuleConditionBase // contains filtered or unexported fields }
func NewFuncValueChangedRuleCondition ¶
func NewFuncValueChangedRuleCondition(f func() interface{}) *FuncValueChangedRuleCondition
func (*FuncValueChangedRuleCondition) Check ¶
func (ruleCond *FuncValueChangedRuleCondition) Check(cell *Cell) (bool, interface{})
type LevelTriggeredRuleCondition ¶
type LevelTriggeredRuleCondition struct {
SimpleCallbackCondition
}
func NewLevelTriggeredRuleCondition ¶
func NewLevelTriggeredRuleCondition(cond func() bool) *LevelTriggeredRuleCondition
func (*LevelTriggeredRuleCondition) Check ¶
func (ruleCond *LevelTriggeredRuleCondition) Check(cell *Cell) (bool, interface{})
type LocFileEntry ¶
type LocFileEntry struct { Devices []LocItem `json:"devices"` Error *ScriptError `json:"error,omitempty"` Rules []LocItem `json:"rules"` VirtualPath string `json:"virtualPath"` PhysicalPath string `json:"-"` }
LocFileEntry represents a source file
type LocFileManager ¶
type LocFileManager interface { ScriptDir() string ListSourceFiles() ([]LocFileEntry, error) LiveWriteScript(virtualPath, content string) error }
LocFileManager interface provides a way to access a list of source files
type OrRuleCondition ¶
type OrRuleCondition struct { RuleConditionBase // contains filtered or unexported fields }
func NewOrRuleCondition ¶
func NewOrRuleCondition(conds []RuleCondition) *OrRuleCondition
func (*OrRuleCondition) Check ¶
func (ruleCond *OrRuleCondition) Check(cell *Cell) (bool, interface{})
func (*OrRuleCondition) GetCells ¶
func (ruleCond *OrRuleCondition) GetCells() []*CellSpec
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
func NewRule ¶
func NewRule(tracker DepTracker, name string, cond RuleCondition, then ESCallbackFunc) *Rule
func (*Rule) IsNonCellRule ¶
IsNonCellRule() returns true if the rule doesn't use any cells for its condition yet shouldn't be invoked upon every RunRules(). This is currently used for cron rules.
func (*Rule) MaybeAddToCron ¶
func (*Rule) ShouldCheck ¶
func (rule *Rule) ShouldCheck()
func (*Rule) StoreInitiallyKnownDeps ¶
func (rule *Rule) StoreInitiallyKnownDeps()
type RuleCondition ¶
type RuleCondition interface { // Check checks whether the rule should be run // and returns a boolean value indicating whether // it should be run and an optional value // to be passed as newValue to the rule. In // case nil is returned as the optional value, // the value of cell must be used. Check(cell *Cell) (bool, interface{}) GetCells() []*CellSpec MaybeAddToCron(cron Cron, thunk func()) (added bool, err error) }
type RuleConditionBase ¶
type RuleConditionBase struct{}
func (*RuleConditionBase) Check ¶
func (ruleCond *RuleConditionBase) Check(Cell *Cell) (bool, interface{})
func (*RuleConditionBase) GetCells ¶
func (ruleCond *RuleConditionBase) GetCells() []*CellSpec
func (*RuleConditionBase) MaybeAddToCron ¶
func (ruleCond *RuleConditionBase) MaybeAddToCron(cron Cron, thunk func()) (bool, error)
type RuleEngine ¶
type RuleEngine struct {
// contains filtered or unexported fields
}
func NewRuleEngine ¶
func NewRuleEngine(model *CellModel, mqttClient wbgo.MQTTClient, options *RuleEngineOptions) (engine *RuleEngine)
func (*RuleEngine) CellModel ¶
func (engine *RuleEngine) CellModel() *CellModel
func (*RuleEngine) CheckTimer ¶
func (engine *RuleEngine) CheckTimer(timerName string) bool
func (*RuleEngine) CloseVirtualCellsDB ¶
func (engine *RuleEngine) CloseVirtualCellsDB() (err error)
Force close virtual cells DB
func (*RuleEngine) DefineRule ¶
func (engine *RuleEngine) DefineRule(rule *Rule)
func (*RuleEngine) DefineVirtualDevice ¶
func (engine *RuleEngine) DefineVirtualDevice(name string, obj objx.Map) error
func (*RuleEngine) GetDeviceProxy ¶
func (engine *RuleEngine) GetDeviceProxy(name string) *DeviceProxy
func (*RuleEngine) IsActive ¶
func (engine *RuleEngine) IsActive() bool
func (*RuleEngine) Log ¶
func (engine *RuleEngine) Log(level EngineLogLevel, message string)
func (*RuleEngine) Logf ¶
func (engine *RuleEngine) Logf(level EngineLogLevel, format string, v ...interface{})
func (*RuleEngine) Publish ¶
func (engine *RuleEngine) Publish(topic, payload string, qos byte, retain bool)
func (*RuleEngine) ReadyCh ¶
func (engine *RuleEngine) ReadyCh() <-chan struct{}
func (*RuleEngine) Refresh ¶
func (engine *RuleEngine) Refresh()
Refresh() should be called after engine rules are altered while the engine is running.
func (*RuleEngine) RunRules ¶
func (engine *RuleEngine) RunRules(cellSpec *CellSpec, timerName string)
func (*RuleEngine) SetCronMaker ¶
func (engine *RuleEngine) SetCronMaker(cronMaker func() Cron)
func (*RuleEngine) SetTimerFunc ¶
func (engine *RuleEngine) SetTimerFunc(timerFunc TimerFunc)
func (*RuleEngine) SetVirtualCellsDB ¶
func (engine *RuleEngine) SetVirtualCellsDB(filename string) (err error)
Create or open virtual cells DB file
func (*RuleEngine) SetVirtualCellsDBMode ¶
func (engine *RuleEngine) SetVirtualCellsDBMode(filename string, mode os.FileMode) (err error)
func (*RuleEngine) Start ¶
func (engine *RuleEngine) Start()
func (*RuleEngine) StartTimer ¶
func (*RuleEngine) StartTrackingDeps ¶
func (engine *RuleEngine) StartTrackingDeps()
func (*RuleEngine) StopTimerByIndex ¶
func (engine *RuleEngine) StopTimerByIndex(n uint64)
func (*RuleEngine) StopTimerByName ¶
func (engine *RuleEngine) StopTimerByName(name string)
func (*RuleEngine) StoreRuleCellSpec ¶
func (engine *RuleEngine) StoreRuleCellSpec(rule *Rule, cellSpec *CellSpec)
func (*RuleEngine) StoreRuleDeps ¶
func (engine *RuleEngine) StoreRuleDeps(rule *Rule)
type RuleEngineOptions ¶
type RuleEngineOptions struct { VirtualCellsStorageFile string VirtualCellsStorageFileMode os.FileMode }
func NewRuleEngineOptions ¶
func NewRuleEngineOptions() *RuleEngineOptions
func (*RuleEngineOptions) SetVirtualCellsStorageFile ¶
func (o *RuleEngineOptions) SetVirtualCellsStorageFile(file string)
func (*RuleEngineOptions) SetVirtualCellsStorageFileMode ¶
func (o *RuleEngineOptions) SetVirtualCellsStorageFileMode(mode os.FileMode)
type ScopedCleanup ¶
type ScopedCleanup struct {
// contains filtered or unexported fields
}
func MakeScopedCleanup ¶
func MakeScopedCleanup() *ScopedCleanup
func (*ScopedCleanup) AddCleanup ¶
func (sc *ScopedCleanup) AddCleanup(cleanupFn CleanupFunc)
func (*ScopedCleanup) PopCleanupScope ¶
func (sc *ScopedCleanup) PopCleanupScope(scope string) string
func (*ScopedCleanup) PushCleanupScope ¶
func (sc *ScopedCleanup) PushCleanupScope(scope string) string
func (*ScopedCleanup) RunCleanups ¶
func (sc *ScopedCleanup) RunCleanups(scope string)
type ScriptError ¶
ScriptError denotes an error that was caused by JavaScript code. Files with such errors are partially loaded.
func NewScriptError ¶
func NewScriptError(message string, traceback []LocItem) ScriptError
func (ScriptError) Error ¶
func (err ScriptError) Error() string
type SimpleCallbackCondition ¶
type SimpleCallbackCondition struct { RuleConditionBase // contains filtered or unexported fields }