emqx_plugins.hrl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2021-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
  3. %%
  4. %% Licensed under the Apache License, Version 2.0 (the "License");
  5. %% you may not use this file except in compliance with the License.
  6. %% You may obtain a copy of the License at
  7. %%
  8. %% http://www.apache.org/licenses/LICENSE-2.0
  9. %%
  10. %% Unless required by applicable law or agreed to in writing, software
  11. %% distributed under the License is distributed on an "AS IS" BASIS,
  12. %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. %% See the License for the specific language governing permissions and
  14. %% limitations under the License.
  15. %%--------------------------------------------------------------------
  16. -ifndef(EMQX_PLUGINS_HRL).
  17. -define(EMQX_PLUGINS_HRL, true).
  18. -define(CONF_ROOT, plugins).
  19. -define(PLUGIN_SERDE_TAB, emqx_plugins_schema_serde_tab).
  20. -define(CONFIG_FORMAT_AVRO, config_format_avro).
  21. -define(CONFIG_FORMAT_MAP, config_format_map).
  22. -type schema_name() :: binary().
  23. -type avsc() :: binary().
  24. -type encoded_data() :: iodata().
  25. -type decoded_data() :: map().
  26. -record(plugin_schema_serde, {
  27. name :: schema_name(),
  28. eval_context :: term(),
  29. %% TODO: fields to mark schema import status
  30. %% scheam_imported :: boolean(),
  31. %% for future use
  32. extra = []
  33. }).
  34. -type plugin_schema_serde() :: #plugin_schema_serde{}.
  35. -endif.