MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cpp-samples / GetPublisher

Function GetPublisher

getting-started/index_gcs_prefix.cc:35–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33using google::cloud::cpp_samples::UpdateObjectMetadata;
34
35pubsub::Publisher GetPublisher() {
36 static auto const publisher = [&] {
37 auto topic =
38 pubsub::Topic(GetEnv("GOOGLE_CLOUD_PROJECT"), GetEnv("TOPIC_ID"));
39 return pubsub::Publisher(
40 pubsub::MakePublisherConnection(std::move(topic), {}));
41 }();
42 return publisher;
43}
44
45spanner::Client GetSpannerClient() {
46 static auto const client = [&] {

Callers 1

IndexGcsPrefixFunction · 0.85

Calls 1

GetEnvFunction · 0.70

Tested by

no test coverage detected