同步操作将从 dgiot开源社区/dgiot 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
This directory keeps a plugins
file which defines all the approved
external plugins from open-source community.
The (maybe broken) symlinks are keept to help testing plugins in this umbrella project.
Add plugin_foo
as a rebar3 dependency in plugins
file.
e.g. For an Erlang plugin named plugin_foo
:
{erlang_plugins,
[ {plugin_foo, {git, "https://github.com/bar/plugin-foo.git", {tag, "0.1.0"}}}
]
}.
Note: The -emqx_plugin(?MODULE)
attribute should be added to
<plugin-name>_app.erl
file to indicate that this is an EMQX Broker plugin.
For example:
%% plugin_foo_app.erl
-emqx_plugin(?MODULE)
$ export EMQX_EXTRA_PLUGINS=plugin_foo,plugin_bar
$ make
If all goes as expected, there should be two directories in the release:
_build/emqx/rel/emqx/lib/plugin_foo-<..vsn..>/
Start the node (interactive mode)
./_build/emqx/rel/emqx/bin/emqx console
Load the plugin with command:
./_build/emqx/rel/emqx/bin/emqx_ctl plugins load plugin_foo
If the plugin is added as a rebar dependency, it should be cloned
to _build/default/lib/plugin_foo
.
Before you can test it, you need to make sure there is a symlink
in lib-extra
pointing to the clone. For instance, the emqx_plugin_template
plugin is linked like this
emqx_plugin_template -> ../_build/default/lib/emqx_plugin_template/
To run its teste cases:
./rebar3 eunit --dir lib-extra/plugin_foo
mkae lib-extra/plugin_foo-ct
NOTE: we should depth=1
shallow clone into _build/
directory,
for plugins being actively developed, you can place the clone in lib-extra/
Elixir dependency in Erlang is not quite nicely supported as incremental builds,
meaning you will not be able to edit the code in this project and get recompiled
in the next make
command.
To have the plugin enabled/loaded by default, you can include it in the template
data/loaded_plugins.tmpl
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。