module GapiConfig:sig..end
Configures Ocurl and authorization method.
type debug_function =
| |
Standard |
(* |
Standard debug function that prints everything on standard output.
| *) |
| |
Custom of |
(* |
Custom debug function.
| *) |
type client_login_config = {
|
username : |
(* |
Username of the Google account.
| *) |
|
password : |
(* |
Password of the Google account.
| *) |
val username : (client_login_config, string) GapiLens.tval password : (client_login_config, string) GapiLens.ttype oauth1_config = {
|
signature_method : |
(* |
Signature method used to sign requests. (
HMAC_SHA1 is the only supported method) | *) |
|
consumer_key : |
(* |
Consumer key.
| *) |
|
consumer_secret : |
(* |
Consumer secret.
| *) |
val signature_method : (oauth1_config, GapiCore.SignatureMethod.t) GapiLens.tval consumer_key : (oauth1_config, string) GapiLens.tval consumer_secret : (oauth1_config, string) GapiLens.ttype oauth2_config = {
|
client_id : |
(* |
Client ID.
| *) |
|
client_secret : |
(* |
Client secret.
| *) |
|
refresh_access_token : |
(* |
Optional external function used to get new access tokens.
| *) |
val client_id : (oauth2_config, string) GapiLens.tval client_secret : (oauth2_config, string) GapiLens.tval refresh_access_token : (oauth2_config, (unit -> string) option) GapiLens.ttype auth_config =
| |
NoAuth |
(* |
No authorization.
| *) |
| |
ClientLogin of |
(* |
Client Login.
| *) |
| |
OAuth1 of |
(* |
OAuth1.
| *) |
| |
OAuth2 of |
(* |
OAuth2.
| *) |
type t = {
|
application_name : |
(* |
Application name, used to build User-Agent HTTP header.
| *) |
|
debug : |
(* |
Debug function used to dump HTTP session. Use
None to disable debug output. | *) |
|
timeout : |
(* |
Global timeout.
None defaults to no timeout. | *) |
|
connect_timeout : |
(* |
Connection timeout.
None defaults to 300 seconds. | *) |
|
compress : |
(* |
Compress requests. (Not yet supported)
| *) |
|
auth : |
(* |
Authorization configuration.
| *) |
|
upload_chunk_size : |
(* |
Chunk default size (in bytes) used by resumable upload. Should be a multiple of 512KB.
| *) |
|
max_send_speed : |
(* |
If an upload exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed.
| *) |
|
max_recv_speed : |
(* |
If a download exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed.
| *) |
|
low_speed_limit : |
(* |
It contains the average transfer speed in bytes per second that the transfer should be below during
low_speed_time seconds for libcurl to consider it to be too slow and abort. Defaults to 0 (disabled). | *) |
|
low_speed_time : |
(* |
It contains the time in number seconds that the transfer speed should be below the
low_speed_limit for the library to consider it too slow and abort. Defaults to 0 (disabled). | *) |
|
curl_no_signal : |
(* |
If
true, libcurl will not use any functions that install signal handlers or any functions that cause signals to be sent to the process. This option is here to allow multi-threaded unix applications to still set/use all timeout options etc, without risking getting signals. Defaults to true | *) |
val application_name : (t, string) GapiLens.tval debug : (t, debug_function option) GapiLens.tval timeout : (t, int option) GapiLens.tval connect_timeout : (t, int option) GapiLens.tval compress : (t, bool) GapiLens.tval auth : (t, auth_config) GapiLens.tval upload_chunk_size : (t, int) GapiLens.tval max_send_speed : (t, int64) GapiLens.tval max_recv_speed : (t, int64) GapiLens.tval low_speed_limit : (t, int) GapiLens.tval low_speed_time : (t, int) GapiLens.tval default : t
let default = {
application_name = "gapi-ocaml";
debug = None;
timeout = None;
connect_timeout = None;
compress = true;
auth = NoAuth;
upload_chunk_size = 10485760; (* 10MB *)
max_send_speed = 0L;
max_recv_speed = 0L;
low_speed_limit = 0;
low_speed_time = 0;
}val default_debug : t
let default_debug = {
application_name = "gapi-ocaml";
debug = Some Standard;
timeout = None;
connect_timeout = None;
compress = false;
auth = NoAuth;
upload_chunk_size = 10485760; (* 10MB *)
max_send_speed = 0L;
max_recv_speed = 0L;
low_speed_limit = 0;
low_speed_time = 0;
}