Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Comcast/rulio
/ functions
Functions
1,122 in github.com/Comcast/rulio
⨍
Functions
1,122
◇
Types & classes
159
↓ 649 callers
Function
Log
Log is the top-level API for logging everything. 'Args' should have an odd number or args. The first arg should be a string, which is typically the
core/log.go:480
↓ 132 callers
Method
Error
()
core/errors.go:25
↓ 74 callers
Function
mapJS
MapJS makes a Map from JSON. If it fails, it panics, so don't use outside of tests.
core/util_test.go:51
↓ 69 callers
Method
Add
(ctx *Context, id string, x Map)
core/state.go:35
↓ 68 callers
Function
NewTimer
NewTimer makes a new timer with the given name. Ctx is optional. If provided and if its system's configuration 'Timing' parameter is false, the a no
core/timers.go:43
↓ 68 callers
Method
Stop
Stop computes the elapsed time (in nanosecs) and stores it in the history.
core/timers.go:96
↓ 57 callers
Function
Now
Now returns the current time in UTC nanoseconds.
core/util.go:176
↓ 57 callers
Function
throwJavascript
Suggested at https://github.com/robertkrimen/otto/issues/17.
core/javascript.go:113
↓ 45 callers
Function
GetStringParam
(m map[string]interface{}, p string, required bool)
service/service.go:128
↓ 45 callers
Function
Inc
Inc atomically updates the given counter.
core/util.go:237
↓ 45 callers
Function
output
(media string, control string, args ...interface{})
doc/api/rulesapi.go:56
↓ 44 callers
Function
checkSearch
checkSearch queries a PatternIndex and checks the results. First parse 'js' as JSON representation of a fact/event. The query the given PatternIndex
core/patternindex_test.go:50
↓ 42 callers
Function
NewPatternIndex
NewPatternIndex does exactly what you think it does.
core/patternindex.go:60
↓ 42 callers
Method
String
()
core/storage.go:29
↓ 41 callers
Function
NewContext
(prefix string)
core/context.go:180
↓ 40 callers
Method
IncErrors
IncErrors increments stats.ErrorCount if err isn't nil.
core/stats.go:159
↓ 39 callers
Method
Close
(ctx *Context)
core/storage.go:53
↓ 38 callers
Method
Add
Index the given fact ID at the given term.
core/termindex.go:95
↓ 38 callers
Method
AddPatternJSON
AddPatternJSON adds the given pattern (as JSON) to the index.
core/patternindex_test.go:36
↓ 34 callers
Method
Set
(x interface{})
core/javascript.go:445
↓ 30 callers
Method
SetLoc
(loc *Location)
core/context.go:112
↓ 27 callers
Function
RunJavascript
RunJavascript executes Javascript code with the given bindings. A new environment is created for each call. That environment contains several bindin
core/javascript.go:511
↓ 26 callers
Method
GetLoc
()
core/context.go:117
↓ 26 callers
Function
Metric
(ctx *Context, args ...interface{})
core/log.go:575
↓ 25 callers
Method
AddFact
(ctx *Context, id string, fact Map)
core/location.go:459
↓ 25 callers
Method
Get
(ctx *Context, id string)
core/state.go:38
↓ 25 callers
Method
findLocation
findLocation is the main function for getting a location. This function delegates the hard work to 'sys.CachedLocations.Open()'.
sys/system.go:855
↓ 23 callers
Method
releaseLocation
releaseLocation is the counterpart to 'findLocation'. Call this function to let the cache know that you are done with some work for a location.
sys/system.go:864
↓ 22 callers
Method
AddFact
AddFact add a fact to the given location. Returns the ID for the fact.
sys/system.go:910
↓ 22 callers
Method
Control
()
core/location.go:91
↓ 22 callers
Function
NewLocation
(ctx *Context, name string, state State, ctrl *Control)
core/location.go:152
↓ 22 callers
Function
Point
Point generates a log line that reports point that applications might want to monitor. A system dashboard is a good example. This function is not a
core/log.go:613
↓ 21 callers
Method
checkLocal
checkLocal is a little utility wrapper around Manager.Disposition. This function will return an error with a JSON message if the given location shoul
service/service.go:161
↓ 20 callers
Function
BenchContext
(appId string)
core/context.go:264
↓ 18 callers
Method
Enabled
(ctx *Context)
core/location.go:205
↓ 18 callers
Function
NewMemStorage
(ctx *Context)
core/storage_mem.go:32
↓ 16 callers
Function
TestContext
(prefix string)
core/context.go:184
↓ 14 callers
Method
Clear
(ctx *Context)
core/state.go:43
↓ 14 callers
Method
ClearLocation
ClearLocation should (!) clear all the state for the given location.
sys/system.go:1123
↓ 14 callers
Function
NewSyntaxError
(s string, args ...interface{})
core/errors.go:79
↓ 14 callers
Method
ProcessEvent
(ctx *Context, event Map)
core/events.go:455
↓ 13 callers
Method
AddValue
AddValue just exists for backwards compatibility. Just calls AddProp().
core/context.go:148
↓ 13 callers
Method
Exec
(*Context, *Location, QueryContext, QueryResult)
core/query.go:81
↓ 13 callers
Method
Load
(ctx *Context)
core/state.go:34
↓ 13 callers
Method
Log
(level LogLevel, args ...interface{})
core/log.go:77
↓ 13 callers
Method
Search
(ctx *Context, pattern Map)
core/state.go:40
↓ 13 callers
Method
SearchFacts
(ctx *Context, pattern Map, includeInherited bool)
core/location.go:621
↓ 13 callers
Function
protest
(w http.ResponseWriter, fm string, args ...interface{})
crolt/handlers.go:26
↓ 12 callers
Method
AddRule
(ctx *Context, id string, rule Map)
core/location.go:311
↓ 12 callers
Method
Do
Do submits work to the breaker. The work is attempted only if the breaker is closed. If the work is attempted, any resulting error is returned. The
core/breaker.go:54
↓ 12 callers
Method
Emit
()
tools/sim/gen.go:29
↓ 12 callers
Method
Update
Update sets the in-memory timestamp of the last update. If 'updating' is empty, then a value is generated using 'GenerateUpdateTimestamp()'. If 'upd
core/location.go:74
↓ 12 callers
Function
linearState
(t *testing.T)
core/state_linear_test.go:23
↓ 11 callers
Method
AddRule
AddRule adds a rule to the given location. Returns the ID for the rule.
sys/system.go:1004
↓ 11 callers
Method
Location
()
core/context.go:125
↓ 11 callers
Function
NewIndexedState
(ctx *Context, name string, store Storage)
core/state_indexed.go:107
↓ 11 callers
Method
Rem
(ctx *Context, id string)
core/state.go:36
↓ 11 callers
Function
indexedState
(t *testing.T)
core/state_indexed_test.go:23
↓ 10 callers
Method
Array
Array returns a pointer to an array of the set's elements.
core/util.go:132
↓ 10 callers
Method
Clear
(ctx *Context)
core/location.go:849
↓ 10 callers
Function
ExampleSystem
(name string)
sys/system.go:524
↓ 10 callers
Function
GetProp
GetProp is the high-level property API to get the property value for the given target id and prop. Default value is provided by 'def'.
core/state.go:266
↓ 10 callers
Function
MustMap
(js string)
core/util.go:533
↓ 10 callers
Function
NewTermIndex
()
core/termindex.go:48
↓ 10 callers
Method
ProcessEvent
(ctx *Context, location string, event string)
sys/system.go:1256
↓ 10 callers
Function
piExample
(ctx *Context, i *PatternIndex, js string, id string)
core/patternindex_test.go:386
↓ 10 callers
Method
slock
(ctx *Context, read bool)
core/state_linear.go:60
↓ 10 callers
Method
slock
(ctx *Context, read bool)
core/state_indexed.go:76
↓ 10 callers
Method
sunlock
(ctx *Context, read bool)
core/state_linear.go:72
↓ 10 callers
Method
sunlock
(ctx *Context, read bool)
core/state_indexed.go:88
↓ 9 callers
Method
Clone
Clone gives a clean copy of the given ServiceStats.
core/stats.go:60
↓ 9 callers
Function
Copy
Copy mostly provides a deep copy of maps.
core/util.go:555
↓ 9 callers
Method
Delete
(ctx *Context)
core/state.go:37
↓ 9 callers
Method
Next
()
tools/sim/gen.go:164
↓ 9 callers
Method
Query
Query runs a query in the given location. For testing.
sys/system.go:1197
↓ 9 callers
Function
RuleFromMap
RuleFromMap generates a Rule from a map.
core/rules.go:186
↓ 9 callers
Method
Search
Search the index. The algorithm is current pretty naive but reasonably efficient. We start with a term that has the lowest cardinality. The set of
core/termindex.go:159
↓ 9 callers
Function
SetProp
SetProp is the high-level property setter. The given id is the target id.
core/state.go:274
↓ 9 callers
Function
TestingLocation
(t *testing.T)
core/rules_test.go:94
↓ 9 callers
Function
doQueryTest
(t *testing.T, facts []string, query string, bss string, initialBss ...Bindings)
core/query_test.go:151
↓ 9 callers
Function
getMapParam
Return a 'map[string]interface{}' value, whether the value was found, and any error. If 'required' is true and the property is missing, return an err
service/service.go:94
↓ 8 callers
Method
Contains
Contains reports whether the given string is in the set
core/util.go:106
↓ 8 callers
Function
NewCron
NewCron creates a new Cron instanced. If the given broadcaster in nil, SysCronBroadcaster is used. Name is opaque; just for logging.
cron/cron.go:194
↓ 8 callers
Function
NewLinearState
(ctx *Context, name string, store Storage)
core/state_linear.go:84
↓ 8 callers
Function
NewNotFoundError
(s string, args ...interface{})
core/errors.go:99
↓ 8 callers
Method
isPrivileged
(region string)
core/context.go:170
↓ 8 callers
Function
protest
(response, message)
examples/add.py:33
↓ 7 callers
Method
Add
Add creates a new cron job. Use the ID to Rem() that job later if you want. F is the work to be performed. The first argument is the scheduled time
cron/cron.go:492
↓ 7 callers
Method
AddPatternMap
AddPatternJSON adds the given pattern (as a map) to the index.
core/patternindex.go:508
↓ 7 callers
Method
CheckRead
(ctx *Context)
core/location.go:142
↓ 7 callers
Method
CheckWrite
(ctx *Context)
core/location.go:129
↓ 7 callers
Method
Do
(ctx *Context)
core/http.go:308
↓ 7 callers
Method
Get
Get looks up a key's value from the cache.
core/cache.go:74
↓ 7 callers
Function
GetPropString
GetPropString is a wrapper around 'getProp' that returns a string value.
core/state.go:196
↓ 7 callers
Method
Load
(ctx *Context, loc string)
core/storage_mem.go:47
↓ 7 callers
Function
NewHTTPRequest
NewHTTPRequest generates a basic HTTPRequest using some defaults from SystemParameters. You can customize the returned instance. For example, you ca
core/http.go:153
↓ 7 callers
Method
Remove
(ctx *Context, loc string, k []byte)
core/storage.go:45
↓ 7 callers
Method
SearchPatternsJSON
SearchPatternsMap searchs the index for patterns that match the given fact (or event) (in JSON).
core/patternindex_test.go:26
↓ 7 callers
Function
genAId
(account, id string)
crolt/cron.go:146
↓ 7 callers
Function
indent
(s string, spaces int)
doc/api/rulesapi.go:62
next →
1–100 of 1,122, ranked by callers