Documentation ¶
Index ¶
- func Configure(bot *models.Bot)
- func Matcher(inputMsgs <-chan models.Message, outputMsgs chan<- models.Message, ...)
- func Outputs(outputMsgs <-chan models.Message, hitRule <-chan models.Rule, bot *models.Bot)
- func Prommetric(input string, bot *models.Bot)
- func Remotes(inputMsgs chan<- models.Message, rules map[string]models.Rule, bot *models.Bot)
- func Rules(rules *map[string]models.Rule, bot *models.Bot)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
Configure searches the config directory for the bot.yml to create a Bot object. The Bot object will be passed around to make accessible system-specific information.
func Matcher ¶
func Matcher(inputMsgs <-chan models.Message, outputMsgs chan<- models.Message, rules map[string]models.Rule, hitRule chan<- models.Rule, bot *models.Bot)
Matcher will search through the map of loaded rules, determine if a rule was hit, and process said rule to be sent out as a message.
func Outputs ¶
Outputs determines where messages are output based on fields set in the bot.yml TODO: Refactor to keep remote specifics in remote/.
func Prommetric ¶
Prommetric creates a local Prometheus server to rule metrics.
func Remotes ¶
Remotes - the purpose of this function is to READ incoming messages from various places, i.e. remotes. Whenever a message is read from a remote, the `inputMsgs` channel will store the read message as a 'Message' object and pass it along to the Matcher function (see '/core/matcher.go') for processing. Currently, we support 3 types of remotes: chat applications, CLI, and Scheduler. Remote 1: Chat applications
This remote allows us to read messages from various chat application platforms, e.g. Slack, Discord, etc. We typically read the messages from these chat applications using their respective APIs. * Note: right now we only support reading from one chat application at a time.
Remote 2: CLI
This remote is enabled when 'CLI mode' is set to true in the bot.yml configuration. Messages from this remote are read from the user's input via the terminal.
Remote 3: Scheduler
This remote allows us to read messages being sent internally by a running cronjob created by a schedule type rule, e.g. see '/config/rules/schedule.yml'.
TODO: Refactor to keep remote specific stuff in remote/.
Types ¶
This section is empty.