|
57 | 57 | -type sc_error() :: {error, Reason :: atom()}. |
58 | 58 | -type security_credentials() :: sc_ok() | sc_error(). |
59 | 59 |
|
60 | | --record(imdsv2token, { token :: security_token() | undefined, |
61 | | - expiration :: non_neg_integer() | undefined}). |
| 60 | +-record(imdsv2token, { |
| 61 | + token :: security_token() | undefined, |
| 62 | + expiration :: non_neg_integer() | undefined |
| 63 | +}). |
62 | 64 |
|
63 | 65 | -type imdsv2token() :: #imdsv2token{}. |
64 | 66 |
|
65 | | --record(state, {access_key :: access_key() | undefined, |
66 | | - secret_access_key :: secret_access_key() | undefined, |
67 | | - expiration :: expiration() | undefined, |
68 | | - security_token :: security_token() | undefined, |
69 | | - region :: region() | undefined, |
70 | | - imdsv2_token:: imdsv2token() | undefined, |
71 | | - error :: atom() | string() | undefined}). |
| 67 | +-record(state, { |
| 68 | + access_key :: access_key() | undefined, |
| 69 | + secret_access_key :: secret_access_key() | undefined, |
| 70 | + expiration :: expiration() | undefined, |
| 71 | + security_token :: security_token() | undefined, |
| 72 | + region :: region() | undefined, |
| 73 | + imdsv2_token :: imdsv2token() | undefined, |
| 74 | + error :: atom() | string() | undefined |
| 75 | +}). |
72 | 76 | -type state() :: #state{}. |
73 | 77 |
|
74 | 78 | -type scheme() :: atom(). |
|
79 | 83 | -type query_args() :: [tuple() | string()]. |
80 | 84 | -type fragment() :: string(). |
81 | 85 |
|
82 | | --type userinfo() :: {undefined | username(), |
83 | | - undefined | password()}. |
| 86 | +-type userinfo() :: {undefined | username(), undefined | password()}. |
84 | 87 |
|
85 | | --type authority() :: {undefined | userinfo(), |
86 | | - host(), |
87 | | - undefined | tcp_port()}. |
88 | | --record(uri, {scheme :: undefined | scheme(), |
89 | | - authority :: authority(), |
90 | | - path :: undefined | path(), |
91 | | - query :: undefined | query_args(), |
92 | | - fragment :: undefined | fragment()}). |
| 88 | +-type authority() :: {undefined | userinfo(), host(), undefined | tcp_port()}. |
| 89 | +-record(uri, { |
| 90 | + scheme :: undefined | scheme(), |
| 91 | + authority :: authority(), |
| 92 | + path :: undefined | path(), |
| 93 | + query :: undefined | query_args(), |
| 94 | + fragment :: undefined | fragment() |
| 95 | +}). |
93 | 96 |
|
94 | 97 | -type method() :: head | get | put | post | trace | options | delete | patch. |
95 | 98 | -type http_version() :: string(). |
|
104 | 107 |
|
105 | 108 | -type ssl_options() :: [ssl:tls_client_option()]. |
106 | 109 |
|
107 | | --type http_option() :: {timeout, timeout()} | |
108 | | - {connect_timeout, timeout()} | |
109 | | - {ssl, ssl_options()} | |
110 | | - {essl, ssl_options()} | |
111 | | - {autoredirect, boolean()} | |
112 | | - {proxy_auth, {User :: string(), Password :: string()}} | |
113 | | - {version, http_version()} | |
114 | | - {relaxed, boolean()} | |
115 | | - {url_encode, boolean()}. |
| 110 | +-type http_option() :: |
| 111 | + {timeout, timeout()} |
| 112 | + | {connect_timeout, timeout()} |
| 113 | + | {ssl, ssl_options()} |
| 114 | + | {essl, ssl_options()} |
| 115 | + | {autoredirect, boolean()} |
| 116 | + | {proxy_auth, {User :: string(), Password :: string()}} |
| 117 | + | {version, http_version()} |
| 118 | + | {relaxed, boolean()} |
| 119 | + | {url_encode, boolean()}. |
116 | 120 | -type http_options() :: [http_option()]. |
117 | 121 |
|
118 | | - |
119 | | --record(request, {access_key :: access_key(), |
120 | | - secret_access_key :: secret_access_key(), |
121 | | - security_token :: security_token(), |
122 | | - service :: string(), |
123 | | - region = "us-east-1" :: string(), |
124 | | - method = get :: method(), |
125 | | - headers = [] :: headers(), |
126 | | - uri :: string(), |
127 | | - body = "" :: body()}). |
| 122 | +-record(request, { |
| 123 | + access_key :: access_key(), |
| 124 | + secret_access_key :: secret_access_key(), |
| 125 | + security_token :: security_token(), |
| 126 | + service :: string(), |
| 127 | + region = "us-east-1" :: string(), |
| 128 | + method = get :: method(), |
| 129 | + headers = [] :: headers(), |
| 130 | + uri :: string(), |
| 131 | + body = "" :: body() |
| 132 | +}). |
128 | 133 | -type request() :: #request{}. |
129 | 134 |
|
130 | | --type httpc_result() :: {ok, {status_line(), headers(), body()}} | |
131 | | - {ok, {status_code(), body()}} | |
132 | | - {error, term()}. |
| 135 | +-type httpc_result() :: |
| 136 | + {ok, {status_line(), headers(), body()}} |
| 137 | + | {ok, {status_code(), body()}} |
| 138 | + | {error, term()}. |
133 | 139 |
|
134 | 140 | -type result_ok() :: {ok, {ResponseHeaders :: headers(), Response :: list()}}. |
135 | | --type result_error() :: {'error', Message :: reason_phrase(), {ResponseHeaders :: headers(), Response :: list()} | undefined} | |
136 | | - {'error', {credentials, Reason :: string()}} | |
137 | | - {'error', string()}. |
| 141 | +-type result_error() :: |
| 142 | + {'error', Message :: reason_phrase(), |
| 143 | + {ResponseHeaders :: headers(), Response :: list()} | undefined} |
| 144 | + | {'error', {credentials, Reason :: string()}} |
| 145 | + | {'error', string()}. |
138 | 146 | -type result() :: result_ok() | result_error(). |
0 commit comments