25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

documentation update (thanks to Karim Gemayel)

This commit is contained in:
Christophe Romain 2010-10-18 16:53:21 +02:00
parent 91cf9194d8
commit 0f3bd782c4

View File

@ -35,112 +35,149 @@
%% ------------------------------- %% -------------------------------
%% Pubsub types %% Pubsub types
%%% @type host() = string(). %% @type host() = string().
%%% <p><tt>host</tt> is the name of the PubSub service. For example, it can be %% <p><tt>host</tt> is the name of the PubSub service. For example, it can be
%%% <tt>"pubsub.localhost"</tt>.</p> %% <tt><<"pubsub.localhost">></tt>.</p>
%%% @type pubsubNode() = [string()]. %% @type nodeId() = binary().
%%% <p>A node is defined by a list of its ancestors. The last element is the name %% <p>A node is defined by a list of its ancestors. The last element is the name
%%% of the current node. For example: %% of the current node. For example:
%%% ```["home", "localhost", "cromain", "node1"]'''</p> %% ```<<"/home/localhost/user">>'''</p>
%%% @type stanzaError() = #xmlelement{}. %% @type nodeIdx() = integer().
%%% Example:
%%% ```{xmlelement, "error",
%%% [{"code", Code}, {"type", Type}],
%%% [{xmlelement, Condition, [{"xmlns", ?NS_STANZAS}], []}]}'''
%%% @type pubsubIQResponse() = #xmlelement{}. %% @type itemId() = string().
%%% Example:
%%% ```{xmlelement, "pubsub",
%%% [{"xmlns", ?NS_PUBSUB_EVENT}],
%%% [{xmlelement, "affiliations", [],
%%% []}]}'''
%%% @type nodeOption() = {Option::atom(), Value::term()}. %% @type subId() = string().
%%% Example:
%%% ```{deliver_payloads, true}'''
%%% @type nodeType() = string(). %% @type payload() = [#xmlelement{} | #xmlcdata{}].
%%% <p>The <tt>nodeType</tt> is a string containing the name of the PubSub
%%% plugin to use to manage a given node. For example, it can be
%%% <tt>"flat"</tt>, <tt>"hometree"</tt> or <tt>"blog"</tt>.</p>
%%% @type jid() = #jid{ %% @type stanzaError() = #xmlelement{}.
%%% user = string(), %% Example:
%%% server = string(), %% ```{xmlelement, "error",
%%% resource = string(), %% [{"code", Code}, {"type", Type}],
%%% luser = string(), %% [{xmlelement, Condition, [{"xmlns", ?NS_STANZAS}], []}]}'''
%%% lserver = string(), %% @type pubsubIQResponse() = #xmlelement{}.
%%% lresource = string()}. %% Example:
%% ```{xmlelement, "pubsub",
%% [{"xmlns", ?NS_PUBSUB_EVENT}],
%% [{xmlelement, "affiliations", [],
%% []}]}'''
%%% @type ljid() = {User::string(), Server::string(), Resource::string()}. %% @type nodeOption() = {Option, Value}.
%% Option = atom(),
%% Value = term().
%% Example:
%% ```{deliver_payloads, true}'''
%%% @type affiliation() = none | owner | publisher | outcast. %% @type nodeType() = string().
%%% @type subscription() = none | pending | unconfigured | subscribed. %% <p>The <tt>nodeType</tt> is a string containing the name of the PubSub
%% plugin to use to manage a given node. For example, it can be
%% <tt>"flat"</tt>, <tt>"hometree"</tt> or <tt>"blog"</tt>.</p>
%%% internal pubsub index table %% @type jid() = {jid, User, Server, Resource, LUser, LServer, LResource}.
-record(pubsub_index, {index, last, free}). %% User = string(),
%% Server = string(),
%% Resource = string(),
%% LUser = string(),
%% LServer = string(),
%% LResource = string().
%%% @type pubsubNode() = #pubsub_node{ %% @type ljid() = {User, Server, Resource}.
%%% nodeid = {Host::host(), Node::pubsubNode()}, %% User = string(),
%%% parentid = Node::pubsubNode(), %% Server = string(),
%%% nodeidx = int(), %% Resource = string().
%%% type = nodeType(),
%%% options = [nodeOption()]}. %% @type affiliation() = 'none' | 'owner' | 'publisher' | 'publish-only' | 'member' | 'outcast'.
%%% <p>This is the format of the <tt>nodes</tt> table. The type of the table
%%% is: <tt>set</tt>,<tt>ram/disc</tt>.</p> %% @type subscription() = 'none' | 'pending' | 'unconfigured' | 'subscribed'.
%%% <p>The <tt>parentid</tt> and <tt>type</tt> fields are indexed.</p>
%%% nodeidx can be anything you want.
-record(pubsub_node, {nodeid, %% @type pubsubIndex() = {pubsub_index, Index, Last, Free}.
%% Index = atom(),
%% Last = integer(),
%% Free = [integer()].
%% internal pubsub index table
-record(pubsub_index,
{
index,
last,
free
}).
%% @type pubsubNode() = {pubsub_node, NodeId, Id, Parents, Type, Owners, Options}.
%% NodeId = {host() | ljid(), nodeId()},
%% Id = nodeIdx(),
%% Parents = [nodeId()],
%% Type = nodeType(),
%% Owners = [ljid()],
%% Options = [nodeOption()].
%% <p>This is the format of the <tt>nodes</tt> table. The type of the table
%% is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
%% <p>The <tt>Parents</tt> and <tt>type</tt> fields are indexed.</p>
%% <tt>id</tt> can be anything you want.
-record(pubsub_node,
{
nodeid,
id, id,
parents = [], parents = [],
type = "flat", type = "flat",
owners = [], owners = [],
options = [] options = []
}). }).
%%% @type pubsubState() = #pubsub_state{ %% @type pubsubState() = {pubsub_state, StateId, Items, Affiliation, Subscriptions}.
%%% stateid = {ljid(), nodeidx()}, %% StateId = {ljid(), nodeIdx()},
%%% items = [ItemId::string()], %% Items = [itemId()],
%%% affiliation = affiliation(), %% Affiliation = affiliation(),
%%% subscriptions = [subscription()]}. %% Subscriptions = [{subscription(), subId()}].
%%% <p>This is the format of the <tt>affiliations</tt> table. The type of the %% <p>This is the format of the <tt>affiliations</tt> table. The type of the
%%% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p> %% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
-record(pubsub_state, {stateid, -record(pubsub_state,
{
stateid,
items = [], items = [],
affiliation = none, affiliation = 'none',
subscriptions = [] subscriptions = []
}). }).
%%% @type pubsubItem() = #pubsub_item{ %% @type pubsubItem() = {pubsub_item, ItemId, Creation, Modification, Payload}.
%%% itemid = {ItemId::string(), nodeidx()}, %% ItemId = {itemId(), nodeIdx()},
%%% creation = {now(), ljid()}, %% Creation = {now(), ljid()},
%%% modification = {now(), ljid()}, %% Modification = {now(), ljid()},
%%% payload = XMLContent::string()}. %% Payload = payload().
%%% <p>This is the format of the <tt>published items</tt> table. The type of the %% <p>This is the format of the <tt>published items</tt> table. The type of the
%%% table is: <tt>set</tt>,<tt>disc</tt>,<tt>fragmented</tt>.</p> %% table is: <tt>set</tt>,<tt>disc</tt>,<tt>fragmented</tt>.</p>
-record(pubsub_item, {itemid, -record(pubsub_item,
creation = {unknown,unknown}, {
modification = {unknown,unknown}, itemid,
creation = {'unknown','unknown'},
modification = {'unknown','unknown'},
payload = [] payload = []
}). }).
%% @type pubsubSubscription() = {pubsub_subscription, SubId, Options}.
%% @type pubsubSubscription() = #pubsub_subscription{ %% SubId = subId(),
%% subid = string(), %% Options = [nodeOption()].
%% state_key = {ljid(), pubsubNodeId()},
%% options = [{atom(), term()}]
%% }.
%% <p>This is the format of the <tt>subscriptions</tt> table. The type of the %% <p>This is the format of the <tt>subscriptions</tt> table. The type of the
%% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p> %% table is: <tt>set</tt>,<tt>ram/disc</tt>.</p>
-record(pubsub_subscription, {subid, options}). -record(pubsub_subscription,
{
subid,
options
}).
%% @type pubsubLastItem() = #pubsub_last_item{ %% @type pubsubLastItem() = {pubsub_last_item, NodeId, ItemId, Creation, Payload}.
%% nodeid = nodeidx(), %% NodeId = nodeIdx(),
%% itemid = string(), %% ItemId = itemId(),
%% payload = XMLContent::string()}. %% Creation = {now(),ljid()},
%% Payload = payload().
%% <p>This is the format of the <tt>last items</tt> table. it stores last item payload %% <p>This is the format of the <tt>last items</tt> table. it stores last item payload
%% for every node</p> %% for every node</p>
-record(pubsub_last_item, {nodeid, itemid, creation, payload}). -record(pubsub_last_item,
{
nodeid,
itemid,
creation,
payload
}).