Skip to content

Finhaven/rust-gcp-pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-gcp-pubsub (Finhaven Forked Version)

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.

Usage

Create a client

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);

Create a topic

let topic = client.create_topic("my-topic").await;

Publish a message

#[derive(Serialize, Default)]
struct Foo {
  pub a: String,
}

let result: Result<(), Error> = topic.publish(Foo::default()).await;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages