aboutsummaryrefslogtreecommitdiff
path: root/src/mod_pubsub_opt.erl
blob: cb3c014b9ab88d6817478790ee3a72ebcdd9ce52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%% Generated automatically
%% DO NOT EDIT: run `make options` instead

-module(mod_pubsub_opt).

-export([access_createnode/1]).
-export([db_type/1]).
-export([default_node_config/1]).
-export([force_node_config/1]).
-export([host/1]).
-export([hosts/1]).
-export([ignore_pep_from_offline/1]).
-export([last_item_cache/1]).
-export([max_item_expire_node/1]).
-export([max_items_node/1]).
-export([max_nodes_discoitems/1]).
-export([max_subscriptions_node/1]).
-export([name/1]).
-export([nodetree/1]).
-export([pep_mapping/1]).
-export([plugins/1]).
-export([vcard/1]).

-spec access_createnode(gen_mod:opts() | global | binary()) -> 'all' | acl:acl().
access_createnode(Opts) when is_map(Opts) ->
    gen_mod:get_opt(access_createnode, Opts);
access_createnode(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, access_createnode).

-spec db_type(gen_mod:opts() | global | binary()) -> atom().
db_type(Opts) when is_map(Opts) ->
    gen_mod:get_opt(db_type, Opts);
db_type(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, db_type).

-spec default_node_config(gen_mod:opts() | global | binary()) -> [{atom(),atom() | integer()}].
default_node_config(Opts) when is_map(Opts) ->
    gen_mod:get_opt(default_node_config, Opts);
default_node_config(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, default_node_config).

-spec force_node_config(gen_mod:opts() | global | binary()) -> [{re:mp(),[{atom(),atom() | integer()}]}].
force_node_config(Opts) when is_map(Opts) ->
    gen_mod:get_opt(force_node_config, Opts);
force_node_config(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, force_node_config).

-spec host(gen_mod:opts() | global | binary()) -> binary().
host(Opts) when is_map(Opts) ->
    gen_mod:get_opt(host, Opts);
host(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, host).

-spec hosts(gen_mod:opts() | global | binary()) -> [binary()].
hosts(Opts) when is_map(Opts) ->
    gen_mod:get_opt(hosts, Opts);
hosts(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, hosts).

-spec ignore_pep_from_offline(gen_mod:opts() | global | binary()) -> boolean().
ignore_pep_from_offline(Opts) when is_map(Opts) ->
    gen_mod:get_opt(ignore_pep_from_offline, Opts);
ignore_pep_from_offline(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, ignore_pep_from_offline).

-spec last_item_cache(gen_mod:opts() | global | binary()) -> boolean().
last_item_cache(Opts) when is_map(Opts) ->
    gen_mod:get_opt(last_item_cache, Opts);
last_item_cache(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, last_item_cache).

-spec max_item_expire_node(gen_mod:opts() | global | binary()) -> 'infinity' | pos_integer().
max_item_expire_node(Opts) when is_map(Opts) ->
    gen_mod:get_opt(max_item_expire_node, Opts);
max_item_expire_node(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, max_item_expire_node).

-spec max_items_node(gen_mod:opts() | global | binary()) -> 'unlimited' | non_neg_integer().
max_items_node(Opts) when is_map(Opts) ->
    gen_mod:get_opt(max_items_node, Opts);
max_items_node(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, max_items_node).

-spec max_nodes_discoitems(gen_mod:opts() | global | binary()) -> 'infinity' | non_neg_integer().
max_nodes_discoitems(Opts) when is_map(Opts) ->
    gen_mod:get_opt(max_nodes_discoitems, Opts);
max_nodes_discoitems(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, max_nodes_discoitems).

-spec max_subscriptions_node(gen_mod:opts() | global | binary()) -> 'undefined' | non_neg_integer().
max_subscriptions_node(Opts) when is_map(Opts) ->
    gen_mod:get_opt(max_subscriptions_node, Opts);
max_subscriptions_node(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, max_subscriptions_node).

-spec name(gen_mod:opts() | global | binary()) -> binary().
name(Opts) when is_map(Opts) ->
    gen_mod:get_opt(name, Opts);
name(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, name).

-spec nodetree(gen_mod:opts() | global | binary()) -> binary().
nodetree(Opts) when is_map(Opts) ->
    gen_mod:get_opt(nodetree, Opts);
nodetree(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, nodetree).

-spec pep_mapping(gen_mod:opts() | global | binary()) -> [{binary(),binary()}].
pep_mapping(Opts) when is_map(Opts) ->
    gen_mod:get_opt(pep_mapping, Opts);
pep_mapping(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, pep_mapping).

-spec plugins(gen_mod:opts() | global | binary()) -> [binary()].
plugins(Opts) when is_map(Opts) ->
    gen_mod:get_opt(plugins, Opts);
plugins(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, plugins).

-spec vcard(gen_mod:opts() | global | binary()) -> 'undefined' | tuple().
vcard(Opts) when is_map(Opts) ->
    gen_mod:get_opt(vcard, Opts);
vcard(Host) ->
    gen_mod:get_module_opt(Host, mod_pubsub, vcard).