Closed grindarius closed 1 month ago
Hey, GCP SDK REST client is basically slim wrapper on reqwest client, so it doesn't have anything fancy for specific APIs such as emulators.
To achieve that you just need to create a config yourself when you need to connect to emulator. Something like:
let config = gcloud_sdk::google_rest_apis::storage_v1::configuration::Configuration {
client: google_rest_client.client.clone(),
base_path: "https://localhost:4443/storage/v1".to_owned(),
..Default::default()
};
you probably want to extract it some kind of function and based on environment variable or config create different configs for prod and localhost.
Thank you for the help. I have decided to make a function that I will call instead of calling create_google_storage_v1_config()
directly to create the local/fake configuration now. Thank you for the help.
Hello and first of all thank you for this amazing library. I am currently wanted to experiment with this library and setup reproducible local environment. But I have a question, how can I connect this library to local fake google cloud server on Docker like
fsouza/fake-gcs-server
? I have looked into how to initializeGoogleRestApi
client that is used for the storage connections but I don't really see how to integrate or set up the client locally. Is there any code examples I can follow somewhere? Thank you.I have tried setting up
fsouza/fake-gcs-server
like this through docker compose.Then I wrote some code like this
Turned out I'm trying to connect the production bucket and not my local bucket, So I am a bit confused how to go on next from here. Thank you for any help.