wbrules

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 25 Imported by: 2

Documentation

Index

Constants

View Source
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
)
View Source
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
)
View Source
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
)
View Source
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
)
View Source
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) DevName

func (cell *Cell) DevName() string

func (*Cell) IsButton

func (cell *Cell) IsButton() bool

func (*Cell) IsComplete

func (cell *Cell) IsComplete() bool

func (*Cell) IsFreshButton

func (cell *Cell) IsFreshButton() bool

IsFreshButton returns true if this cell corresponds to a button that didn't receive value yet.

func (*Cell) Max

func (cell *Cell) Max() float64

func (*Cell) Name

func (cell *Cell) Name() string

func (*Cell) RawValue

func (cell *Cell) RawValue() string

func (*Cell) SetValue

func (cell *Cell) SetValue(value interface{})

func (*Cell) Type

func (cell *Cell) Type() string

func (*Cell) Value

func (cell *Cell) Value() interface{}

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

type CellModel struct {
	wbgo.ModelBase
	// contains filtered or unexported fields
}

func NewCellModel

func NewCellModel() *CellModel

func (*CellModel) AcquireCellChangeChannel

func (model *CellModel) AcquireCellChangeChannel() chan *CellSpec

func (*CellModel) AddExternalDevice

func (model *CellModel) AddExternalDevice(name string) (wbgo.ExternalDeviceModel, error)

func (*CellModel) CallSync

func (model *CellModel) CallSync(thunk func())

func (*CellModel) EnsureCell

func (model *CellModel) EnsureCell(cellSpec *CellSpec) *Cell

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 (model *CellModel) MustGetCell(cellSpec *CellSpec) *Cell

func (*CellModel) MustGetDevice

func (model *CellModel) MustGetDevice(name string) (dev CellModelDevice)

func (*CellModel) ReleaseCellChangeChannel

func (model *CellModel) ReleaseCellChangeChannel(ch chan *CellSpec)

func (*CellModel) RemoveLocalDevice

func (model *CellModel) RemoveLocalDevice(name string)

func (*CellModel) Start

func (model *CellModel) Start() error

func (*CellModel) Stop

func (model *CellModel) Stop()

func (*CellModel) WhenReady

func (model *CellModel) WhenReady(thunk func())

type CellModelDevice

type CellModelDevice interface {
	wbgo.DeviceModel
	EnsureCell(name string) (cell *Cell)
	MustGetCell(name string) (cell *Cell)
	// contains filtered or unexported methods
}

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

func (cellProxy *CellProxy) IsComplete() bool

func (*CellProxy) RawValue

func (cellProxy *CellProxy) RawValue() string

func (*CellProxy) SetValue

func (cellProxy *CellProxy) SetValue(value interface{})

func (*CellProxy) Value

func (cellProxy *CellProxy) Value() interface{}

type CellSpec

type CellSpec struct {
	DevName  string
	CellName string
}

type CellType

type CellType int

type CleanupFunc

type CleanupFunc func()

type CommandResult

type CommandResult struct {
	ExitStatus          int
	CapturedOutput      string
	CapturedErrorOutput string
}

func Spawn

func Spawn(name string, args []string, captureOutput bool, captureErrorOutput bool, input *string) (*CommandResult, error)

type Cron

type Cron interface {
	AddFunc(spec string, cmd func()) error
	Start()
	Stop()
}

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 DepTracker interface {
	StartTrackingDeps()
	StoreRuleCellSpec(rule *Rule, cellSpec *CellSpec)
	StoreRuleDeps(rule *Rule)
}

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 ESCallbackFunc func(args objx.Map) interface{}

type ESContext

type ESContext struct {
	*duktape.Context
	// contains filtered or unexported fields
}

func (*ESContext) DefaultCallbackErrorHandler

func (ctx *ESContext) DefaultCallbackErrorHandler(err ESError)

func (*ESContext) DefineFunctions

func (ctx *ESContext) DefineFunctions(fns map[string]func() int)

func (*ESContext) EvalScript

func (ctx *ESContext) EvalScript(code string) error

func (*ESContext) Format

func (ctx *ESContext) Format() string

func (*ESContext) GetESError

func (ctx *ESContext) GetESError() (r ESError)

func (*ESContext) GetESErrorAugmentingSyntaxErrors

func (ctx *ESContext) GetESErrorAugmentingSyntaxErrors(path string) (r ESError)

func (*ESContext) GetJSObject

func (ctx *ESContext) GetJSObject(objIndex int) interface{}

func (*ESContext) GetTraceback

func (ctx *ESContext) GetTraceback() ESTraceback

func (*ESContext) LoadAndCallFunctionFromString

func (ctx *ESContext) LoadAndCallFunctionFromString(filename, content string) error

func (*ESContext) LoadScenario

func (ctx *ESContext) LoadScenario(path string) error

LoadScenario wraps loaded script into closure and gives extra global objects with additional information about environment

func (*ESContext) LoadScript

func (ctx *ESContext) LoadScript(path string) error

func (*ESContext) LoadScriptFromString

func (ctx *ESContext) LoadScriptFromString(filename, content string) error

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 (ctx *ESContext) StringArrayToGo(arrIndex int) []string

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

func (engine *ESEngine) ClosePersistentDB() (err error)

Force close DB

func (*ESEngine) EvalScript

func (engine *ESEngine) EvalScript(code string) error

func (*ESEngine) ListSourceFiles

func (engine *ESEngine) ListSourceFiles() (entries []LocFileEntry, err error)

func (*ESEngine) LiveLoadFile

func (engine *ESEngine) LiveLoadFile(path string) error

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 (engine *ESEngine) LiveRemoveFile(path string) error

func (*ESEngine) LiveWriteScript

func (engine *ESEngine) LiveWriteScript(virtualPath, content string) error

func (*ESEngine) LoadFile

func (engine *ESEngine) LoadFile(path string) (err error)

func (*ESEngine) ModSearch

func (engine *ESEngine) ModSearch(ctx *duktape.Context) int

native modSearch implementation

func (*ESEngine) ScriptDir

func (engine *ESEngine) ScriptDir() string

func (*ESEngine) SetPersistentDB

func (engine *ESEngine) SetPersistentDB(filename string) error

Create or open DB file

func (*ESEngine) SetPersistentDBMode

func (engine *ESEngine) SetPersistentDBMode(filename string, mode os.FileMode) (err error)

func (*ESEngine) SetSourceRoot

func (engine *ESEngine) SetSourceRoot(sourceRoot string) (err error)

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
}

func (ESError) Error

func (err ESError) Error() string

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) Remove

func (editor *Editor) Remove(args *EditorPathArgs, reply *bool) 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 EditorSaveArgs struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

type EditorSaveResponse

type EditorSaveResponse struct {
	Error     interface{} `json:"error,omitempty",`
	Path      string      `json:"path"`
	Traceback []LocItem   `json:"traceback,omitempty"`
}

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 LocItem

type LocItem struct {
	Line int    `json:"line"`
	Name string `json:"name"`
}

LocItem represents a device or rule location in the source file

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) Check

func (rule *Rule) Check(cell *Cell)

func (*Rule) Destroy

func (rule *Rule) Destroy()

func (*Rule) IsNonCellRule

func (rule *Rule) IsNonCellRule() bool

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 *Rule) MaybeAddToCron(cron Cron)

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 (engine *RuleEngine) StartTimer(name string, callback func(), interval time.Duration, periodic bool) uint64

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

type ScriptError struct {
	Message   string    `json:"message"`
	Traceback []LocItem `json:"traceback"`
}

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
}

type TimerEntry

type TimerEntry struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type TimerFunc

type TimerFunc func(id uint64, d time.Duration, periodic bool) wbgo.Timer

Jump to

Keyboard shortcuts

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