This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Title | |
## Body | |
## @path listeners | |
listeners { | |
## @doc TCP listeners | |
## @path listeners.tcp | |
## @type map_struct() | |
# tcp.name = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# author:xijin.c | |
read -r -p "请输入文件存储目录名: " dir | |
cd /data | |
mkdir $dir | |
cd $dir | |
# 生成CA key【采用2048字节】 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Title | |
## Body | |
listeners { | |
## @doc | |
## TCP listeners | |
## | |
## @path listeners.tcp | |
## @type map() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(emqx_api_spec). | |
%% API | |
-include_lib("typerefl/include/types.hrl"). | |
%% -import(emqx_schema, [t/1, t/3, t/4, ref/1]). | |
-export([api_spec/0 | |
, spec/1]). | |
api_spec() -> ["/plain/style", "/schema/style"]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init([]) –> | |
timer:send_interval(?TIME,self(),loop_interval_event), | |
{ok, #state{}}. | |
handle_info(loop_interval_event, State) -> | |
NewState = do_loop_inverval_event(State), | |
{noreply, NewState}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init([]) –> | |
{ok, #state{},next_report_time()}. | |
handle_info(timeout,State) –> | |
NewState = do_report_event(State),%% maybe spawn for heavy task | |
{noreply,NewState,next_report_time()}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init([]) –> | |
erlang:send_after(next_report_time(),self(),report_event), | |
{ok, #state{}}. | |
handle_info(report_event, State) –> | |
NewState = do_report_event(State),%% maybe spawn for heavy task | |
erlang:send_after(next_time_report(),self(),report_event), | |
{noreply, NewState}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Client do | |
use Maxwell.Builder, ~w(post)a | |
middleware Maxwell.Middleware.BaseUrl, "http://httpbin.org" | |
middleware Maxwell.Middleware.Opts, [connect_timeout: 10000, recv_timeout: 20000] | |
middleware Maxwell.Middleware.Json | |
adapter Maxwell.Adapter.Hackney | |
@doc """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule SendMultipartClient do | |
use Maxwell.Builder, ~w(post)a | |
middleware Maxwell.Middleware.BaseUrl, "http://httpbin.org" | |
middleware Maxwell.Middleware.Opts, [connect_timeout: 10000, recv_timeout: 20000] | |
middleware Maxwell.Middleware.DecodeJson | |
adapter Maxwell.Adapter.Hackney | |
@doc """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule SendFileClient do | |
use Maxwell.Builder, ~w(post)a | |
middleware Maxwell.Middleware.BaseUrl, "http://httpbin.org" | |
middleware Maxwell.Middleware.Opts, [connect_timeout: 10000, recv_timeout: 20000] | |
adapter Maxwell.Adapter.Hackney | |
@doc """ | |
Post whole file once |
NewerOlder