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