mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-27 01:50:38 +00:00
[proxy] Introduce cloud::Api for communication with Neon Cloud
* `cloud::legacy` talks to Cloud API V1. * `cloud::api` defines Cloud API v2. * `cloud::local` mocks the Cloud API V2 using a local postgres instance. * It's possible to choose between API versions using the `--api-version` flag.
This commit is contained in:
committed by
Stas Kelvich
parent
9df8915b03
commit
af0195b604
@@ -185,10 +185,10 @@ impl<S: AsyncRead + AsyncWrite + Unpin> Client<S> {
|
||||
|
||||
// Authenticate and connect to a compute node.
|
||||
let auth = creds.authenticate(config, &mut stream).await;
|
||||
let db_info = async { auth }.or_else(|e| stream.throw_error(e)).await?;
|
||||
let node = async { auth }.or_else(|e| stream.throw_error(e)).await?;
|
||||
|
||||
let (db, version, cancel_closure) =
|
||||
db_info.connect().or_else(|e| stream.throw_error(e)).await?;
|
||||
node.connect().or_else(|e| stream.throw_error(e)).await?;
|
||||
let cancel_key_data = session.enable_cancellation(cancel_closure);
|
||||
|
||||
stream
|
||||
|
||||
Reference in New Issue
Block a user