agala v2.0.0 API Reference
Modules
Main framework module. Basic Application
. Should be started as external application
in your mix.exs
file in order to use Agala
This module represents main Bot supervisor
Module, represents the bank which gets messages from poller and then syncronosly proceeds them
You can use this behaviour for implementing your own provider
Behaviour, represents the bank which gets Agala.Conn from Chain and then syncronosly proceeds them to response
Behavior for modules that represent permanent storage system for Agala bot
This module specified generic system for configuration all the variety of Agala
bots.
It helps to keep types of the params in consistence
The Chain specification. There are two kind of Chains: function Chains and module Chains.
Function Chains
A function Chain is any function that receives a connection and a set of options and returns a connection. Its type signature must be:
(Agala.Conn.t, Agala.Chain.opts) :: Agala.Conn.t
Module Chains
A module Chain is an extension of the function Chain. It is a module that must export:
- a
call/2
function with the signature defined above - an
init/1
function which takes a set of options and initializes it. The result returned byinit/1
is passed as second argument tocall/2
. Note thatinit/1
may be called during compilation and as such it must not return pids, ports or values that are not specific to the runtime. The API expected by a module Chain is defined as a behaviour by theAgala.Chain
module (this module).
Examples
Here’s an example of a function Chain:
#TODO
Here’s an example of a module Chain:
#TODO
The Chain pipeline
The Agala.Chain.Builder
module provides conveniences for building Chain
pipelines
Loopback automaticly sends response back to the bot, which got the request
The Agala connection
This module represents a set of macros, that can be used to performed multiple
operation inside one Agala.Conn
instance
Behaviour that defines root structure for Agala provider