Skip to content

savonarola/emqx-plugin-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMQX Plugin Helper

EMQX Plugin Helper is a helper library for creating EMQX plugins.

It's main purpose is to provide the most common macros and records from EMQX to the plugin without the need to depend on a large part of EMQX in compile time.

Usage

Add as a dependency (the plugin generator will do that automatically) to the plugin's rebar.lock:

{deps,
    [
        {emqx_plugin_helper, {git, "https://github.com/emqx/emqx_plugin_helper.git", {tag, "v5.9.0"}}}
    ]
}

In the plugin code, include the necessary headers from EMQX:

%% for #message{} record, etc.
-include_lib("emqx_plugin_helper/include/emqx.hrl").

%% For ?SLOG macros, etc.
-include_lib("emqx_plugin_helper/include/logger.hrl").

%% For hook priorities
-include_lib("emqx_plugin_helper/include/emqx_hooks.hrl").

%% For MQTT-related constants
-include_lib("emqx_plugin_helper/include/emqx_mqtt.hrl").

License

This project is licensed under the Apache-2.0 License.

About

Helper library for creating EMQX plugins

Resources

License

Stars

Watchers

Forks

Packages

No packages published