add deps
This commit is contained in:
parent
5fd69f0347
commit
6618ba5511
58
apps/endpoint/include/endpoint.hrl
Normal file
58
apps/endpoint/include/endpoint.hrl
Normal file
@ -0,0 +1,58 @@
|
||||
%%%-------------------------------------------------------------------
|
||||
%%% @author anlicheng
|
||||
%%% @copyright (C) 2024, <COMPANY>
|
||||
%%% @doc
|
||||
%%% 数据类型统一为 LineProtocol
|
||||
%%% @end
|
||||
%%% Created : 06. 5月 2024 18:17
|
||||
%%%-------------------------------------------------------------------
|
||||
-author("anlicheng").
|
||||
|
||||
-record(http_endpoint, {
|
||||
url = <<>> :: binary(),
|
||||
pool_size = 10 :: integer()
|
||||
}).
|
||||
|
||||
-record(mqtt_endpoint, {
|
||||
host = <<>> :: binary(),
|
||||
port = 0 :: integer(),
|
||||
client_id = <<>> :: binary(),
|
||||
username = <<>> :: binary(),
|
||||
password = <<>> :: binary(),
|
||||
topic = <<>> :: binary(),
|
||||
qos = 0 :: integer()
|
||||
}).
|
||||
|
||||
-record(kafka_endpoint, {
|
||||
username = <<>> :: binary(),
|
||||
password = <<>> :: binary(),
|
||||
bootstrap_servers = [] :: [binary()],
|
||||
topic = <<>> :: binary()
|
||||
}).
|
||||
|
||||
-record(mysql_endpoint, {
|
||||
host = <<>> :: binary(),
|
||||
port = 0 :: integer(),
|
||||
username = <<>> :: binary(),
|
||||
password = <<>> :: binary(),
|
||||
database = <<>> :: binary(),
|
||||
table_name = <<>> :: binary(),
|
||||
pool_size = 10 :: integer()
|
||||
}).
|
||||
|
||||
-record(endpoint, {
|
||||
id :: integer(),
|
||||
%% 标题描述
|
||||
title = <<>> :: binary(),
|
||||
mapper = <<>> :: binary(),
|
||||
%% 数据转换规则,基于
|
||||
%% fun(LocationCode :: binary(), Fields :: [{<<"key">> => <<>>, <<"value">> => <<>>, <<"unit">> => <<>>}])
|
||||
%% fun(LocationCode :: binary(), Fields :: [{<<"key">> => <<>>, <<"value">> => <<>>, <<"unit">> => <<>>}], Timestamp :: integer())
|
||||
mapper_fun = fun(_, Fields) -> Fields end :: fun(),
|
||||
%% 配置项, 格式: #{<<"protocol">> => <<"http|https|ws|kafka|mqtt">>, <<"args">> => #{}}
|
||||
config = #http_endpoint{} :: #http_endpoint{} | #mqtt_endpoint{} | #kafka_endpoint{} | #mysql_endpoint{},
|
||||
%% 更新时间
|
||||
updated_at = 0 :: integer(),
|
||||
%% 创建时间
|
||||
created_at = 0 :: integer()
|
||||
}).
|
||||
@ -5,7 +5,13 @@
|
||||
{mod, {endpoint_app, []}},
|
||||
{applications,
|
||||
[
|
||||
poolboy,
|
||||
hackney,
|
||||
sync,
|
||||
mysql,
|
||||
emqtt,
|
||||
parse_trans,
|
||||
lager,
|
||||
kernel,
|
||||
stdlib
|
||||
]},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user