emqx_gateway.hrl 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. %%--------------------------------------------------------------------
  2. %% Copyright (c) 2021-2023 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_GATEWAY_HRL).
  17. -define(EMQX_GATEWAY_HRL, 1).
  18. -type gateway_name() :: atom().
  19. %% @doc The Gateway definition
  20. -type gateway() ::
  21. #{
  22. name := gateway_name(),
  23. %% Description
  24. descr => binary() | undefined,
  25. %% Appears only in getting gateway info
  26. status => stopped | running | unloaded,
  27. %% Timestamp in millisecond
  28. created_at => integer(),
  29. %% Timestamp in millisecond
  30. started_at => integer(),
  31. %% Timestamp in millisecond
  32. stopped_at => integer(),
  33. %% Appears only in getting gateway info
  34. config => emqx_config:config()
  35. }.
  36. -type gateway_def() ::
  37. #{
  38. name := gateway_name(),
  39. callback_module := module(),
  40. config_schema_module := module()
  41. }.
  42. -endif.