diff options
Diffstat (limited to 'src/gun.erl')
-rw-r--r-- | src/gun.erl | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/gun.erl b/src/gun.erl index bad1418..badd691 100644 --- a/src/gun.erl +++ b/src/gun.erl @@ -91,21 +91,42 @@ | {text | binary | close | ping | pong, iodata()} | {close, ws_close_code(), iodata()}. --type opts() :: map(). +-type opts() :: #{ + connect_timeout => timeout(), + http_opts => http_opts(), + http2_opts => http2_opts(), + protocols => [http | http2], + retry => non_neg_integer(), + retry_timeout => pos_integer(), + trace => boolean(), + transport => tcp | ssl, + transport_opts => [gen_tcp:connect_option()] | [ssl:connect_option()], + ws_opts => ws_opts() +}. -export_type([opts/0]). %% @todo Add an option to disable/enable the notowner behavior. --type req_opts() :: map(). +-type req_opts() :: #{ + reply_to => pid() +}. -export_type([req_opts/0]). --type http_opts() :: map(). +-type http_opts() :: #{ + keepalive => timeout(), + transform_header_name => fun((binary()) -> binary()), + version => 'HTTP/1.1' | 'HTTP/1.0' +}. -export_type([http_opts/0]). --type http2_opts() :: map(). +-type http2_opts() :: #{ + keepalive => timeout() +}. -export_type([http2_opts/0]). %% @todo keepalive --type ws_opts() :: map(). +-type ws_opts() :: #{ + compress => boolean() +}. -export_type([ws_opts/0]). -record(state, { |