This module defines the interface that all OpenFlax handlers should export, and any common functionality that they should share.
| behaviour_info/1 | Yields a list of functions which must be exported by each handler module that implements this behaviour. |
| start_all/2 | Starts all installed handler modules. |
behaviour_info(X1::callbacks) -> [{function_name(), arity()}]
Yields a list of functions which must be exported by each handler module that implements this behaviour.
start(conf()) -> conf() This callback should initialize the handler and return a new
conf() if the initialization was successful;
otherwise, it should simply fail due to error. The returned
conf() will be merged into the global configuration
section; therefore, it should be obtained from a call to
openflax.conf:new/0 or /1, and
should not simply be a copy of the conf() which
was passed to start/1.
stop(conf()) -> conf() This callback should shutdown all activity of the handler
and return the conf() it was given, perhaps with
modifications.
serve(conf()) -> {response(), conf()} This callback should serve the resource implemented by the handler.
The handler may, of course, serve any number of different kinds of
resources, most likely based on the URL and/or the form arguments
of the request, which may be found in the conf() passed
to serve/1. It should return a response()
as well as the conf() it was passed, perhaps with
modifications.
start_all(GlobalConf::conf(), MasterDict::master_dict()) -> conf()
Starts all installed handler modules.
These handlers are listed in the handler -> conf()
dictionary passed to start_all/1, which typically is
drawn from the configuration files.