fix(emqx): Move bpapi and emqx message record to emqx_utils app
This commit is contained in:
parent
74cb43f8b1
commit
7cb0322856
|
@ -14,9 +14,4 @@
|
||||||
%% limitations under the License.
|
%% limitations under the License.
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
-ifndef(EMQX_BPAPI_HRL).
|
-include_lib("emqx_utils/include/bpapi.hrl").
|
||||||
-define(EMQX_BPAPI_HRL, true).
|
|
||||||
|
|
||||||
-compile({parse_transform, emqx_bpapi_trans}).
|
|
||||||
|
|
||||||
-endif.
|
|
||||||
|
|
|
@ -55,29 +55,7 @@
|
||||||
|
|
||||||
-record(subscription, {topic, subid, subopts}).
|
-record(subscription, {topic, subid, subopts}).
|
||||||
|
|
||||||
%% See 'Application Message' in MQTT Version 5.0
|
-include_lib("emqx_utils/include/emqx_message.hrl").
|
||||||
-record(message, {
|
|
||||||
%% Global unique message ID
|
|
||||||
id :: binary(),
|
|
||||||
%% Message QoS
|
|
||||||
qos = 0,
|
|
||||||
%% Message from
|
|
||||||
from :: atom() | binary(),
|
|
||||||
%% Message flags
|
|
||||||
flags = #{} :: emqx_types:flags(),
|
|
||||||
%% Message headers. May contain any metadata. e.g. the
|
|
||||||
%% protocol version number, username, peerhost or
|
|
||||||
%% the PUBLISH properties (MQTT 5.0).
|
|
||||||
headers = #{} :: emqx_types:headers(),
|
|
||||||
%% Topic that the message is published to
|
|
||||||
topic :: emqx_types:topic(),
|
|
||||||
%% Message Payload
|
|
||||||
payload :: emqx_types:payload(),
|
|
||||||
%% Timestamp (Unit: millisecond)
|
|
||||||
timestamp :: integer(),
|
|
||||||
%% not used so far, for future extension
|
|
||||||
extra = [] :: term()
|
|
||||||
}).
|
|
||||||
|
|
||||||
-record(delivery, {
|
-record(delivery, {
|
||||||
%% Sender of the delivery
|
%% Sender of the delivery
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
-export_type([options/0]).
|
-export_type([options/0]).
|
||||||
|
|
||||||
-include_lib("emqx/include/emqx.hrl").
|
-include_lib("emqx_utils/include/emqx_message.hrl").
|
||||||
-include_lib("snabbkaffe/include/trace.hrl").
|
-include_lib("snabbkaffe/include/trace.hrl").
|
||||||
|
|
||||||
%%================================================================================
|
%%================================================================================
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
-export_type([options/0]).
|
-export_type([options/0]).
|
||||||
|
|
||||||
-include_lib("emqx/include/emqx.hrl").
|
-include_lib("emqx_utils/include/emqx_message.hrl").
|
||||||
|
|
||||||
%%================================================================================
|
%%================================================================================
|
||||||
%% Type declarations
|
%% Type declarations
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
{vsn, "0.1.6"},
|
{vsn, "0.1.6"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, rocksdb, gproc, mria]},
|
{applications, [kernel, stdlib, rocksdb, gproc, mria, emqx_utils]},
|
||||||
{mod, {emqx_ds_app, []}},
|
{mod, {emqx_ds_app, []}},
|
||||||
{env, []}
|
{env, []}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
-behavior(emqx_bpapi).
|
-behavior(emqx_bpapi).
|
||||||
|
|
||||||
-include_lib("emqx/include/bpapi.hrl").
|
-include_lib("emqx_utils/include/bpapi.hrl").
|
||||||
%% API:
|
%% API:
|
||||||
-export([open_shard/3, drop_shard/2, get_streams/4, make_iterator/5, next/4]).
|
-export([open_shard/3, drop_shard/2, get_streams/4, make_iterator/5, next/4]).
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
%%--------------------------------------------------------------------
|
||||||
|
%% Copyright (c) 2017-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||||
|
%%
|
||||||
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
%% you may not use this file except in compliance with the License.
|
||||||
|
%% You may obtain a copy of the License at
|
||||||
|
%%
|
||||||
|
%% http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
%%
|
||||||
|
%% Unless required by applicable law or agreed to in writing, software
|
||||||
|
%% distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
%% See the License for the specific language governing permissions and
|
||||||
|
%% limitations under the License.
|
||||||
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
|
-ifndef(EMQX_BPAPI_HRL).
|
||||||
|
-define(EMQX_BPAPI_HRL, true).
|
||||||
|
|
||||||
|
-compile({parse_transform, emqx_bpapi_trans}).
|
||||||
|
|
||||||
|
-endif.
|
|
@ -0,0 +1,43 @@
|
||||||
|
%%--------------------------------------------------------------------
|
||||||
|
%% Copyright (c) 2022-2023 EMQ Technologies Co., Ltd. All Rights Reserved.
|
||||||
|
%%
|
||||||
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
%% you may not use this file except in compliance with the License.
|
||||||
|
%% You may obtain a copy of the License at
|
||||||
|
%%
|
||||||
|
%% http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
%%
|
||||||
|
%% Unless required by applicable law or agreed to in writing, software
|
||||||
|
%% distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
%% See the License for the specific language governing permissions and
|
||||||
|
%% limitations under the License.
|
||||||
|
%%--------------------------------------------------------------------
|
||||||
|
-ifndef(EMQX_MESSAGE_HRL).
|
||||||
|
-define(EMQX_MESSAGE_HRL, true).
|
||||||
|
|
||||||
|
%% See 'Application Message' in MQTT Version 5.0
|
||||||
|
-record(message, {
|
||||||
|
%% Global unique message ID
|
||||||
|
id :: binary(),
|
||||||
|
%% Message QoS
|
||||||
|
qos = 0,
|
||||||
|
%% Message from
|
||||||
|
from :: atom() | binary(),
|
||||||
|
%% Message flags
|
||||||
|
flags = #{} :: emqx_types:flags(),
|
||||||
|
%% Message headers. May contain any metadata. e.g. the
|
||||||
|
%% protocol version number, username, peerhost or
|
||||||
|
%% the PUBLISH properties (MQTT 5.0).
|
||||||
|
headers = #{} :: emqx_types:headers(),
|
||||||
|
%% Topic that the message is published to
|
||||||
|
topic :: emqx_types:topic(),
|
||||||
|
%% Message Payload
|
||||||
|
payload :: emqx_types:payload(),
|
||||||
|
%% Timestamp (Unit: millisecond)
|
||||||
|
timestamp :: integer(),
|
||||||
|
%% not used so far, for future extension
|
||||||
|
extra = [] :: term()
|
||||||
|
}).
|
||||||
|
|
||||||
|
-endif.
|
Loading…
Reference in New Issue