2008年3月31日星期一

ejabberd模块开发

Introduction

ejabberd internal modules works as plugins. Each module is an erlang module with a name beginning with “mod_”. If you don’t already know Erlang, you should also take a look at this doc.

API of the module

All the internal modules must use the “gen_mod” behavior.

It must provide the following API:

start(Host, Opts) -> ok
stop(Host) -> ok
* Host = string()
* Opts = [{Name, Value}]
* Name = Value = string()

Host is the name of the virtual host running the module. The start/2 and stop/1 functions are called for each virtual host at start and stop time of the server.
Opts is a lists of options set in the configuration file for the module. They can be retrieved with the gen mod:get opt/3 function.

没有评论: