Merge pull request #9102 from zmstone/1005-chore-sync-some-modules
chore: sync diverged modules modules from ee back to ce
This commit is contained in:
commit
eaeb26a1b4
|
@ -1,6 +1,6 @@
|
|||
[
|
||||
{
|
||||
"name": "mongo",
|
||||
"name": "mongo_single",
|
||||
"listen": "0.0.0.0:27017",
|
||||
"upstream": "mongo:27017",
|
||||
"enabled": true
|
||||
|
|
|
@ -686,7 +686,7 @@ heal_failure(FailureType, ProxyHost, ProxyPort) ->
|
|||
end.
|
||||
|
||||
switch_proxy(Switch, ProxyHost, ProxyPort) ->
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo",
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo_single",
|
||||
Body = case Switch of
|
||||
off -> <<"{\"enabled\":false}">>;
|
||||
on -> <<"{\"enabled\":true}">>
|
||||
|
@ -695,27 +695,27 @@ switch_proxy(Switch, ProxyHost, ProxyPort) ->
|
|||
[{body_format, binary}]).
|
||||
|
||||
timeout_proxy(on, ProxyHost, ProxyPort) ->
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo/toxics",
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo_single/toxics",
|
||||
Body = <<"{\"name\":\"timeout\",\"type\":\"timeout\","
|
||||
"\"stream\":\"upstream\",\"toxicity\":1.0,"
|
||||
"\"attributes\":{\"timeout\":0}}">>,
|
||||
{ok, {{_, 200, _}, _, _}} = httpc:request(post, {Url, [], "application/json", Body}, [],
|
||||
[{body_format, binary}]);
|
||||
timeout_proxy(off, ProxyHost, ProxyPort) ->
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo/toxics/timeout",
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo_single/toxics/timeout",
|
||||
Body = <<>>,
|
||||
{ok, {{_, 204, _}, _, _}} = httpc:request(delete, {Url, [], "application/json", Body}, [],
|
||||
[{body_format, binary}]).
|
||||
|
||||
latency_up_proxy(on, ProxyHost, ProxyPort) ->
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo/toxics",
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo_single/toxics",
|
||||
Body = <<"{\"name\":\"latency_up\",\"type\":\"latency\","
|
||||
"\"stream\":\"upstream\",\"toxicity\":1.0,"
|
||||
"\"attributes\":{\"latency\":20000,\"jitter\":3000}}">>,
|
||||
{ok, {{_, 200, _}, _, _}} = httpc:request(post, {Url, [], "application/json", Body}, [],
|
||||
[{body_format, binary}]);
|
||||
latency_up_proxy(off, ProxyHost, ProxyPort) ->
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo/toxics/latency_up",
|
||||
Url = "http://" ++ ProxyHost ++ ":" ++ integer_to_list(ProxyPort) ++ "/proxies/mongo_single/toxics/latency_up",
|
||||
Body = <<>>,
|
||||
{ok, {{_, 204, _}, _, _}} = httpc:request(delete, {Url, [], "application/json", Body}, [],
|
||||
[{body_format, binary}]).
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
用户需要实现的方法,和数据类型的定义在 `priv/protos/exhook.proto` 文件中:
|
||||
|
||||
```protobuff
|
||||
```protobuf
|
||||
syntax = "proto3";
|
||||
|
||||
package emqx.exhook.v1;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
详情参见:`priv/protos/exproto.proto`,例如接口的定义有:
|
||||
|
||||
```protobuff
|
||||
```protobuf
|
||||
syntax = "proto3";
|
||||
|
||||
package emqx.exproto.v1;
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
|
||||
-record(resource_params,
|
||||
{ id :: resource_id()
|
||||
, params :: #{} %% the params got after initializing the resource
|
||||
, params :: map() %% the params got after initializing the resource
|
||||
, status = #{is_alive => false} :: #{is_alive := boolean(), atom() => term()}
|
||||
}).
|
||||
|
||||
|
|
Loading…
Reference in New Issue