Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/Netflix/hal-9001
/ functions
Functions
585 in github.com/Netflix/hal-9001
⨍
Functions
585
◇
Types & classes
101
↓ 4,096 callers
Function
charRow
charRow converts a string representation of binary uint8 to uint8. This is a bit inefficient but it keeps the font easy to edit and it only needs to r
hal/text2image.go:71
↓ 138 callers
Method
Printf
Printf formats the message and propagates it as a log message.
hal/logger.go:105
↓ 52 callers
Method
Replyf
Replyf is the same as Reply but allows for string formatting using fmt.Sprintf()
hal/event.go:127
↓ 44 callers
Method
Register
Register registers a plugin with the bot.
hal/plugins.go:74
↓ 39 callers
Method
SubCmd
()
hal/cmd.go:771
↓ 36 callers
Method
SetUsage
SetUsage sets the usage string for the command. Returns the command.
hal/cmd.go:461
↓ 32 callers
Method
AddKVParam
AddKVParam creates and adds a key/value parameter to the command handle and returns the new parameter.
hal/cmd.go:296
↓ 31 callers
Method
Debugf
Debugf formats the message and propagates it. No work is performed if debugging is disabled.
hal/logger.go:136
↓ 30 callers
Method
AddAlias
AddAlias adds an alias to the command and returns the paramter.
hal/cmd.go:400
↓ 28 callers
Method
String
()
hal/cmd.go:168
↓ 27 callers
Method
Fatalf
Fatalf formats the message, propagates the log, then exits the program.
hal/logger.go:154
↓ 26 callers
Method
Reply
Reply is a helper that crafts a new event from the provided string and initiates the reply on the broker attached to the event. The message is routed
hal/event.go:89
↓ 24 callers
Function
SqlDB
DB returns the database singleton.
hal/sqldb.go:35
↓ 22 callers
Method
Println
Println merges the arguments and propagates the result as a log message.
hal/logger.go:120
↓ 20 callers
Method
AddSubCmd
AddCmd adds a subcommand to the handle and returns the new (sub-)command.
hal/cmd.go:780
↓ 18 callers
Function
logit
(err error)
plugins/pagerduty/poller.go:182
↓ 17 callers
Method
Name
the text name of the broker, arbitrary, but usually "slack" or "cli"
hal/broker.go:22
↓ 16 callers
Function
SqlInit
SqlInit executes the provided SQL once per runtime. Execution is not tracked across restarts so statements still need to use CREATE TABLE IF NOT EXIST
hal/sqldb.go:77
↓ 15 callers
Method
AddIdxParam
AddIdxParam adds a positional parameter to the command and returns the new parameter.
hal/cmd.go:325
↓ 15 callers
Method
Error
Error replies to the event with the provided error. Future: need to figure out if there's going to be a kind of error handling module in Hal for makin
hal/event.go:135
↓ 15 callers
Method
Process
parse a list of argv-style strings (0 is always the command name e.g. []string{"prefs"}) foo bar --baz foo --bar baz --version foo bar=baz foo x=y z=q
hal/cmd.go:871
↓ 14 callers
Method
BodyAsArgv
BodyAsArgv does minimal parsing of the event body, returning an argv-like array of strings with quoted strings intact (but with quotes removed). The g
hal/event.go:234
↓ 14 callers
Method
BrokerName
BrokerName returns the text name of current broker.
hal/event.go:175
↓ 14 callers
Method
MustString
MustString returns the value as a string. If it was required/not-set, panic ensues. Empty string may be returned for not-required+not-set.
hal/cmd.go:1868
↓ 13 callers
Method
Error
()
plugins/google_calendar/google.go:45
↓ 12 callers
Method
Get
Get retrieves a value from the database. If the database returns an error, Success will be false and the Error field will be populated.
hal/prefs.go:165
↓ 12 callers
Method
_idxparams
_idxparams makes sure the _idxparams map is initialized and returns the map.
hal/cmd.go:260
↓ 11 callers
Method
SubCmdInst
()
hal/cmd.go:1324
↓ 11 callers
Method
SubCmdToken
SubCmdToken returns the subcommand's token string. Returns empty string if there is no subcommand.
hal/cmd.go:1308
↓ 11 callers
Method
Value
()
hal/cmd.go:167
↓ 10 callers
Method
Found
()
hal/cmd.go:165
↓ 10 callers
Method
GetKVParamInst
GetKVParamInst gets a key/value parameter instance by its key.
hal/cmd.go:1375
↓ 10 callers
Method
GetPlugin
GetPlugin returns the plugin specified by its name string.
hal/plugins.go:240
↓ 10 callers
Method
Set
Set writes the value and returns a new struct with the new value.
hal/prefs.go:243
↓ 10 callers
Method
_boolparams
_boolparams makes sure the _boolparams list is initialized and returns the list.
hal/cmd.go:251
↓ 10 callers
Method
_kvparams
_kvparams makes sure the _kvparams list is initialized and returns the list.
hal/cmd.go:242
↓ 9 callers
Method
DefString
(def string)
hal/cmd.go:1911
↓ 9 callers
Method
Key
()
hal/cmd.go:525
↓ 9 callers
Method
PutEdge
(keyA, kindA, keyB, kindB string)
hal/directory.go:247
↓ 9 callers
Method
Required
()
hal/cmd.go:166
↓ 9 callers
Function
authenticatedGet
AuthenticatedGet authenticates with the provided token and GETs the url.
plugins/pagerduty/helpers.go:36
↓ 9 callers
Function
pagedUrl
(resource string, offset, limit int, params map[string][]string)
plugins/pagerduty/helpers.go:71
↓ 8 callers
Method
Clone
Clone() returns a copy of the event with the same broker/room/user and a current timestamp. Body, Command, and Subject will be empty. Time is updated
hal/event.go:61
↓ 8 callers
Method
Duration
()
hal/cmd.go:1815
↓ 8 callers
Method
Instance
Instance creates an instance of a plugin. It is *not* registered (and therefore not considered by the router until that is done).
hal/plugins.go:116
↓ 8 callers
Method
ListKVParamInsts
ListKVParamInsts initializes the kvparaminsts list on the fly and returns it.
hal/cmd.go:1593
↓ 8 callers
Method
ReplyTable
ReplyTable sends a table of data back, formatting it according to preferences. TODO: move code from brokers/slack/broker.go/SendTable here TODO: docum
hal/event.go:143
↓ 8 callers
Method
Usage
()
hal/cmd.go:191
↓ 8 callers
Method
initialize
initialize allocates channels and starts the background goroutines that forward output to stdout
hal/logger.go:71
↓ 7 callers
Method
AsPref
AsPref returns a a pref with user, room, broker, and plugin set using data from the event handle.
hal/event.go:211
↓ 7 callers
Method
GetIdxParamInstByName
GetIdxParamInsByNamet gets an indexed parameter instance by its name.
hal/cmd.go:1538
↓ 7 callers
Method
ListSubCmds
ListSubCmds makes sure the SubCmds list is initialized and returns the list.
hal/cmd.go:233
↓ 7 callers
Function
PluginRegistry
()
hal/plugins.go:64
↓ 7 callers
Method
Put
Put is an alias for Set
hal/secrets.go:128
↓ 7 callers
Method
PutNode
(key, kind string)
hal/directory.go:183
↓ 6 callers
Method
Cmd
Cmd returns the command it was called on. It does nothing and exists to make it possible to format chained calls nicely.
hal/cmd.go:767
↓ 6 callers
Method
InstanceList
InstanceList returns a snapshot of the instance list at call time.
hal/plugins.go:226
↓ 6 callers
Method
ListBoolParamInsts
ListBoolParamInsts initializes the boolparaminsts list on the fly and returns it.
hal/cmd.go:1602
↓ 6 callers
Method
Panicf
Panicf formats a message and panics. Not propagated.
hal/logger.go:187
↓ 6 callers
Method
ParseColor
ParseColor parses a 6-byte or 8-byte hex color string (HTML-style) and returns a color.RGBA. If anything goes wrong during parsing, it returns the def
hal/text2image.go:6090
↓ 6 callers
Method
Send
(evt Evt)
hal/broker.go:23
↓ 6 callers
Method
SetDefault
(def string)
hal/cmd.go:507
↓ 6 callers
Method
newInst
(cmdinst *CmdInst, subcmdinst *SubCmdInst, isdef bool, value string)
hal/cmd.go:628
↓ 5 callers
Method
HasBoolParam
(string)
hal/cmd.go:179
↓ 5 callers
Method
HasKVParam
(string)
hal/cmd.go:178
↓ 5 callers
Method
Name
()
hal/cmd.go:190
↓ 5 callers
Method
One
One returns the most-specific preference from the Prefs according to the precedence order of user>room>broker>plugin>global.
hal/prefs.go:427
↓ 5 callers
Method
Remainder
Remainder initializes the remainder list on the fly and returns it.
hal/cmd.go:1631
↓ 5 callers
Method
RoomIdToName
RoomIdToName gets the human-readable room name for a user ID using an in-memory cache that falls through to the Slack API
brokers/slack/broker.go:665
↓ 5 callers
Function
SlackTime
SlackTime converts the timestamp string to time.Time
brokers/slack/broker.go:532
↓ 5 callers
Method
Table
Table returns Prefs as a 2d list ready to hand off to e.g. hal.AsciiTable()
hal/prefs.go:537
↓ 5 callers
Method
UserIdToName
UserIdToName gets the human-readable username for a user ID using an in-memory cache that falls through to the Slack API
brokers/slack/broker.go:623
↓ 5 callers
Function
clean
(in string)
plugins/pagerduty/oncall_plugin.go:438
↓ 5 callers
Method
errParam
()
hal/cmd.go:172
↓ 5 callers
Method
exec
(sql string, params ...interface{})
hal/directory.go:102
↓ 5 callers
Method
mapIdxParamInsts
mapIdxParamInsts initializes the idxparaminsts list on the fly and returns it.
hal/cmd.go:1611
↓ 5 callers
Function
requireEnv
(key string)
example/everything/main.go:168
↓ 4 callers
Method
AddBroker
AddBroker adds a broker to the router and starts forwarding events between it and the router.
hal/router.go:71
↓ 4 callers
Method
Exists
(key string)
hal/ttlcache.go:108
↓ 4 callers
Method
FindKey
(key string)
hal/prefs.go:308
↓ 4 callers
Method
FindPrefs
FindPrefs fetches the union of all matching settings from the database for user, broker, room, and plugin. Plugins can use the Prefs methods to filter
hal/event.go:182
↓ 4 callers
Method
GetBroker
GetBroker retrieves a broker handle by name.
hal/router.go:95
↓ 4 callers
Method
Register
Register puts a pf in the global list and makes it available to GetPeriodicFunc. Anonymous pf's work fine but are not retreivable.
hal/periodic.go:120
↓ 4 callers
Method
Route
Route is the main method for the router. It blocks and should be run in a goroutine exactly once. Running more than one router in the same process wil
hal/router.go:129
↓ 4 callers
Method
SetPrefix
SetPrefix sets a new prefix that will be prepended to every message from the logger handle.
hal/logger.go:100
↓ 4 callers
Method
Start
Start a periodic function.
hal/periodic.go:134
↓ 4 callers
Method
assertZeroIdxParams
assertZeroIdxParams panics if there are any IdxParam defined.
hal/cmd.go:278
↓ 4 callers
Method
find
(keyRequired bool)
hal/prefs.go:319
↓ 4 callers
Function
getSecrets
TODO: consider making the token key per-room so different rooms can use different tokens doing this will require a separate cache object per token...
plugins/pagerduty/plugin.go:64
↓ 4 callers
Function
getSpamKey
(scope, id string)
plugins/google_calendar/plugin.go:263
↓ 4 callers
Method
query
(sql string, params ...interface{})
hal/directory.go:113
↓ 4 callers
Method
respond
(status, message string)
plugins/pagerduty/pd_events_v1.go:150
↓ 4 callers
Function
stripAutoLinks
(in string)
plugins/prefmgr/plugin.go:259
↓ 3 callers
Method
AddBoolParam
AddBoolParam adds a boolean/flag parameter to the command and returns the new parameter.
hal/cmd.go:310
↓ 3 callers
Method
FindInstances
FindInstances returns the plugin instances that match the provided room id, broker, and plugin name.
hal/plugins.go:255
↓ 3 callers
Method
GetIdxParamInst
GetIdxParamInst gets a positional parameter instance by its index.
hal/cmd.go:1499
↓ 3 callers
Function
GetOncalls
https://v2.developer.pagerduty.com/v2/page/api-reference#!/On-Calls/get_oncalls TODO: figure out if query should be a typed struct or validated
plugins/pagerduty/pd_oncall.go:27
↓ 3 callers
Method
NewBroker
(name string)
brokers/slack/broker.go:69
↓ 3 callers
Function
NewCmd
NewCmd returns an initialized Cmd.
hal/cmd.go:227
↓ 3 callers
Function
NewEvent
NewEvent returns an initialized Event structure. You probably don't want to use this and instead use NewTrigger/NewAck/NewResolve.
plugins/pagerduty/pd_events_v1.go:78
next →
1–100 of 585, ranked by callers