feat: patch after merge master branch

This commit is contained in:
x1001100011 2021-10-17 21:04:46 -07:00
parent 0312f07b11
commit b76334ea01
5 changed files with 61 additions and 2 deletions

View File

@ -35,7 +35,8 @@ defmodule EMQX.MixProject do
{:hocon, github: "emqx/hocon"},
{:pbkdf2, github: "emqx/erlang-pbkdf2", tag: "2.0.4"},
{:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "0.14.0"},
{:jiffy, github: "emqx/jiffy", tag: "1.0.5"}
{:jiffy, github: "emqx/jiffy", tag: "1.0.5"},
{:lc, github: "qzhuyan/lc", tag: "0.1.1"}
]
end
end

View File

@ -22,7 +22,6 @@
-include("logger.hrl").
-include_lib("lc/include/lc.hrl").
%% gen_event callbacks
-export([ init/1
, handle_event/2

View File

@ -10,6 +10,8 @@ defmodule EMQXExhook.MixProject do
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.12",
compilers: [:protos | Mix.compilers()],
aliases: ["compile.protos": &protos/1],
start_permanent: Mix.env() == :prod,
deps: deps(),
description: "EMQ X Extension for Hook"
@ -30,4 +32,28 @@ defmodule EMQXExhook.MixProject do
{:grpc, github: "emqx/grpc-erl", tag: "0.6.2"}
]
end
defp protos(_args) do
app_path = Path.expand("..", __ENV__.file)
config = [
:use_packages,
:maps,
:strings_as_binaries,
rename: {:msg_name, :snake_case},
rename: {:msg_fqname, :base_name},
i: '.',
report_errors: false,
o: app_path |> Path.join("src") |> to_charlist(),
module_name_prefix: 'emqx_',
module_name_suffix: '_pb'
]
app_path
|> Path.join("priv/protos/*.proto")
|> Path.wildcard()
|> Enum.map(&to_charlist/1)
|> Enum.each(&:gpb_compile.file(&1, config))
:ok
end
end

32
apps/emqx_limiter/mix.exs Normal file
View File

@ -0,0 +1,32 @@
defmodule EMQXLimiter.MixProject do
use Mix.Project
def project do
[
app: :emqx_limiter,
version: "1.0.0",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.12",
start_permanent: Mix.env() == :prod,
deps: deps(),
description: "EMQ X Hierachical Limiter"
]
end
def application do
[
registered: [:emqx_limiter_sup],
mod: {:emqx_limiter_app, []},
extra_applications: [:logger]
]
end
defp deps do
[
{:emqx, in_umbrella: true, runtime: false}
]
end
end

View File

@ -25,6 +25,7 @@
"jiffy": {:git, "https://github.com/emqx/jiffy.git", "baa1f4e750ae3c5c9e54f9c2e52280b7fc24a8d9", [tag: "1.0.5"]},
"jose": {:hex, :jose, "1.11.2", "f4c018ccf4fdce22c71e44d471f15f723cb3efab5d909ab2ba202b5bf35557b3", [:mix, :rebar3], [], "hexpm", "98143fbc48d55f3a18daba82d34fe48959d44538e9697c08f34200fa5f0947d2"},
"jsx": {:hex, :jsx, "3.1.0", "d12516baa0bb23a59bb35dccaf02a1bd08243fcbb9efe24f2d9d056ccff71268", [:rebar3], [], "hexpm", "0c5cc8fdc11b53cc25cf65ac6705ad39e54ecc56d1c22e4adb8f5a53fb9427f3"},
"lc": {:git, "https://github.com/qzhuyan/lc.git", "6f38a748af0993bb4e440a0f9223d6aa7b90b86b", [tag: "0.1.1"]},
"lwm2m_coap": {:git, "https://github.com/emqx/lwm2m-coap.git", "495f3c62fae153040c89f9a0ba5344789ff5acc8", [tag: "v2.0.0"]},
"minirest": {:git, "https://github.com/emqx/minirest.git", "60c1a5a1f5df00a662cb34cf4101c7a21ffe08f9", [tag: "1.2.4"]},
"mysql": {:git, "https://github.com/emqx/mysql-otp.git", "bdabac44cc8836a9e23897b7e1b77c7df7e04f70", [tag: "1.7.1"]},