package gapi-ocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=5cc769af46198deb88707ccb50398088316e60f51db8c36389e6a2aae4c2ad30
md5=d918a22fde1b1d49a9783fb2f932d059
doc/gapi-ocaml/GapiConfig/index.html
Module GapiConfigSource
Configuration module.
Configures Ocurl and authorization method.
type debug_function = | Standard(*Standard debug function that prints everything on standard output.
*)| Custom of Curl.t -> Curl.curlDebugType -> string -> unit(*Custom debug function.
*)
Curl debug function used to log server interactions.
type client_login_config = {username : string;(*Username of the Google account.
*)password : string;(*Password of the Google account.
*)
}Client Login parameters.
Client Login username lens.
Client Login password lens.
type oauth1_config = {signature_method : GapiCore.SignatureMethod.t;(*Signature method used to sign requests. (
*)HMAC_SHA1is the only supported method)consumer_key : string;(*Consumer key.
*)consumer_secret : string;(*Consumer secret.
*)
}OAuth 1.0a parameters.
OAuth1 signature method lens.
OAuth1 consumer key lens.
OAuth1 consumer secret lens.
type oauth2_config = {client_id : string;(*Client ID.
*)client_secret : string;(*Client secret.
*)refresh_access_token : (unit -> string) option;(*Optional external function used to get new access tokens.
*)
}OAuth 2 parameters.
OAuth2 client ID lens.
OAuth2 client secret lens.
OAuth2 optional external token refresh function lens.
type oauth2_service_account_config = {service_account_credentials_json : string;(*Service account credentials JSON file content.
*)scopes : string list;(*List of scopes that the application requests.
*)user_to_impersonate : string option;(*Optional user to impersonate (for G Suite domains).
*)refresh_service_account_access_token : (unit -> string) option;(*Optional external function used to get new access tokens.
*)
}OAuth 2 (for service accounts) parameters.
OAuth2 service account credentials JSON file content (lens).
List of scopes that the application requests (lens).
Optional user to impersonate (lens).
val refresh_service_account_access_token :
(oauth2_service_account_config, (unit -> string) option) GapiLens.tOptional external function used to get new access tokens (lens).
type auth_config = | NoAuth(*No authorization.
*)| ClientLogin of client_login_config(*Client Login.
*)| OAuth1 of oauth1_config(*OAuth1.
*)| OAuth2 of oauth2_config(*OAuth2.
*)| OAuth2ServiceAccount of oauth2_service_account_config(*OAuth2 for service accounts.
*)
Authorization method.
type t = {application_name : string;(*Application name, used to build User-Agent HTTP header.
*)debug : debug_function option;(*Debug function used to dump HTTP session. Use
*)Noneto disable debug output.timeout : int option;(*Global timeout.
*)Nonedefaults to no timeout.connect_timeout : int option;(*Connection timeout.
*)Nonedefaults to 300 seconds.compress : bool;(*Compress requests. (Not yet supported)
*)auth : auth_config;(*Authorization configuration.
*)upload_chunk_size : int;(*Chunk default size (in bytes) used by resumable upload. Should be a multiple of 512KB.
*)max_send_speed : int64;(*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 : int64;(*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 : int;(*It contains the average transfer speed in bytes per second that the transfer should be below during
*)low_speed_timeseconds for libcurl to consider it to be too slow and abort. Defaults to 0 (disabled).low_speed_time : int;(*It contains the time in number seconds that the transfer speed should be below the
*)low_speed_limitfor the library to consider it too slow and abort. Defaults to 0 (disabled).curl_no_signal : bool;(*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 totrue.proxy : string option;(*Set the proxy to use. The parameter should be a string holding the host name or dotted numerical IP address. A numerical IPv6 address must be written within brackets. Defaults to
*)None. To specify port number in this string, append:portto the end of the host name.ssl_verifypeer : bool;(*When
*)ssl_verifypeeris enabled, and the verification fails to prove that the certificate is authentic, the connection fails. When the option is disabled, the peer certificate verification succeeds regardless. Defaults totrue.
}Library configuration.
Application name lens.
Debug function lens.
Timeout lens.
Connection timeout lens.
Compression flag lens.
Authorization configuration lens.
Upload chunk size lens.
Max send speed lens.
Max receive speed lens.
Low speed limit lens.
Low speed time lens.
Default configuration.
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;
}Default configuration with debug output enabled.
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;
}