A chatops automation framework for Slack in Go
Lazlo An event-driven, lua-scriptable chatops automation framework for Slack in Go. (phew)
The prototypical IRC bot responds to text. Generally, the pattern is you provide a regex to match on, and some code to run when someone says something in chat that matches your regular expression. Your plugin runs when a pattern match happens, and then returns.
Your Lazlo module, by comparison is started at runtime and stays resident in memory. Outwardly, Lazlo acts like a bot, but internally Lazlo works as an event broker. Your module registers for callbacks -- you can tell Lazlo what sorts of events your module finds interesting. For each callback your module registers, Lazlo will hand back a channel. Your module can block on the channel, waiting for something to happen, or it can register more callbacks (as many as you have memory for), and select between them in a loop. Throughout its lifetime, your Module can de-register the callbacks it doesn't need anymore, and ask for new ones as circumstances demand.
Currently there are five different kinds of callbacks you can ask for.
Your module can register for all or none of these, as many times as it likes during the lifetime of the bot. Lazlo makes it easier to write modules that carry out common chat-ops patterns. For example, you can pretty easily write a module that:
bot deploy (\w+)
That's an oversimplified example, but I hope you get the idea. Check out the Modules directory for working examples that use the various callbacks.
Lua plug-ins
Lazlo's event-driven framework is quite flexible. You can use it to write some pretty powerful modules in Go. For example, I implemented a module that embeds a lua state machine which makes it possible to extend Lazlo by write simple plugins that use hubot-like syntax in lua
Whats next?
Current Status
Lazlo is basically working and basically documented. All callback types are implemented and functional and there are several included modules of varying degress of complexity that should help get you started writing your own.
Todo's in order of when I'll probably get to them:
Twice a month we will interview people behind open source businesses. We will talk about how they are building a business on top of open source projects.
We'll never share your email with anyone else.