A crate that acts as a HTTP client to publish and read messages from Google Cloud Platform's PubSub.
Authentication is provided by rust-goauth, which expects a path to the file containing your Google Cloud service account JSON key.
rust
let google_credentials = std::env::var("GOOGLE_PUBSUB_CREDENTIALS").unwrap();
let mut client = gcp_pubsub::Client::new(credentials);
rust
let topic = client.create_topic("my-topic").await;
```rust
struct Foo { pub a: String, }
let result: Result<(), Error> = topic.publish(Foo::default()).await; ```
rust
let subscription = topic.create_subscription().await.unwrap();
let messages : Result<Vec<gcp_pubsub::Message>, Error> = subscription.pull().await;