Cosmos_eio.Databasesmodule type Auth_key = Cosmos.Databases_intf.Auth_keymodule Credential : sig ... endmodule type Credentials = Cosmos.Databases_intf.CredentialsA deferred IO computation. Call with () to execute. This is the Eio equivalent of 'a Lwt.t; computations are deferred as thunks so that with_timeout can cancel them via Eio's fiber cancellation.
val with_env :
sw:Eio.Switch.t ->
< clock : _ Eio.Time.clock ; net : _ Eio.Net.t.. > ->
(unit -> 'a) ->
'awith_env ~sw env f sets up the Eio environment (clock, network, TLS client) required by Database operations. All database calls must happen inside f. Call this once inside Eio_main.run and Eio.Switch.run.
module Response_headers : sig ... endtype batch_validation_error = Cosmos.Databases_core.batch_validation_error = type cosmos_error = Cosmos.Databases_core.Cosmos_error.t = | Timeout_error| Connection_error| Http_error of string| Azure_error of int * Response_headers.tval string_of_cosmos_error : cosmos_error -> stringHuman-readable description of a cosmos_error.
module type S = Database_intf.Smodule Database_as (C : Credentials) : SDatabase_as connects with an arbitrary credential, e.g. a resource token minted through Permission. Master-key-only operations (list_databases, User, Permission, Offer) fail with Azure_error (401 | 403, _) under a resource token.
val credentials_of_token : endpoint:string -> string -> (module Credentials)credentials_of_token ~endpoint token wraps a permission's _token as credentials suitable for Database_as.
val credentials_of_token_provider :
endpoint:string ->
(unit -> string) ->
(module Credentials)credentials_of_token_provider ~endpoint provider calls provider for every request, so callers can refresh expiring resource tokens.