Skip to content

Commit

Permalink
Update sample topic and subscription names
Browse files Browse the repository at this point in the history
Change example topic and subscription names to `my-topic` and `my-sub` to establish conventions across Pub/Sub.
  • Loading branch information
kenfesta authored and fhinkel committed Sep 21, 2018
1 parent 6de5603 commit 109bd40
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion samples/quickstart.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const pubsubClient = new PubSub({
});

// The name for the new topic
const topicName = 'my-new-topic';
const topicName = 'my-topic';

// Creates the new topic
pubsubClient
Expand Down
32 changes: 16 additions & 16 deletions samples/subscriptions.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function listTopicSubscriptions(topicName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';

// Lists all subscriptions for the topic
pubsub
Expand Down Expand Up @@ -86,8 +86,8 @@ function createSubscription(topicName, subscriptionName) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const subscriptionName = 'your-subscription';
// const topicName = 'my-topic';
// const subscriptionName = 'my-sub';

// Creates a new subscription
pubsub
Expand Down Expand Up @@ -119,8 +119,8 @@ function createFlowControlledSubscription(
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const subscriptionName = 'your-subscription';
// const topicName = 'my-topic';
// const subscriptionName = 'my-sub';
// const maxInProgress = 5;
// const maxBytes = 10000;

Expand Down Expand Up @@ -167,8 +167,8 @@ function createPushSubscription(topicName, subscriptionName) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const subscriptionName = 'your-subscription';
// const topicName = 'my-topic';
// const subscriptionName = 'my-sub';

const options = {
pushConfig: {
Expand Down Expand Up @@ -203,8 +203,8 @@ function modifyPushConfig(topicName, subscriptionName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const subscriptionName = 'your-subscription';
// const topicName = 'my-topic';
// const subscriptionName = 'my-sub';

const options = {
// Set to an HTTPS endpoint of your choice. If necessary, register
Expand Down Expand Up @@ -236,7 +236,7 @@ function deleteSubscription(subscriptionName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';

// Deletes the subscription
pubsub
Expand All @@ -261,7 +261,7 @@ function getSubscription(subscriptionName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';

// Gets the metadata for the subscription
pubsub
Expand Down Expand Up @@ -292,7 +292,7 @@ function listenForMessages(subscriptionName, timeout) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';
// const timeout = 60;

// References an existing subscription
Expand Down Expand Up @@ -406,7 +406,7 @@ function listenForErrors(subscriptionName, timeout) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';
// const timeout = 60;

// References an existing subscription
Expand Down Expand Up @@ -448,7 +448,7 @@ function getSubscriptionPolicy(subscriptionName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';

// Retrieves the IAM policy for the subscription
pubsub
Expand All @@ -475,7 +475,7 @@ function setSubscriptionPolicy(subscriptionName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';

// The new IAM policy
const newPolicy = {
Expand Down Expand Up @@ -521,7 +521,7 @@ function testSubscriptionPermissions(subscriptionName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const subscriptionName = 'your-subscription';
// const subscriptionName = 'my-sub';

const permissionsToTest = [
`pubsub.subscriptions.consume`,
Expand Down
18 changes: 9 additions & 9 deletions samples/topics.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function createTopic(topicName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';

// Creates a new topic
pubsub
Expand All @@ -83,7 +83,7 @@ function deleteTopic(topicName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';

// Deletes the topic
pubsub
Expand All @@ -110,7 +110,7 @@ function publishMessage(topicName, data) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';
// const data = JSON.stringify({ foo: 'bar' });

// Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject)
Expand Down Expand Up @@ -141,7 +141,7 @@ function publishMessageWithCustomAttributes(topicName, data) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';
// const data = JSON.stringify({ foo: 'bar' });

// Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject)
Expand Down Expand Up @@ -176,7 +176,7 @@ function publishBatchedMessages(topicName, data, maxMessages, maxWaitTime) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';
// const data = JSON.stringify({ foo: 'bar' });
// const maxMessages = 10;
// const maxWaitTime = 10000;
Expand Down Expand Up @@ -224,7 +224,7 @@ function publishOrderedMessage(topicName, data) {
/**
* TODO(developer): Uncomment the following lines to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';
// const data = JSON.stringify({ foo: 'bar' });

// Publishes the message as a string, e.g. "Hello, world!" or JSON.stringify(someObject)
Expand Down Expand Up @@ -267,7 +267,7 @@ function getTopicPolicy(topicName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';

// Retrieves the IAM policy for the topic
pubsub
Expand All @@ -294,7 +294,7 @@ function setTopicPolicy(topicName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';

// The new IAM policy
const newPolicy = {
Expand Down Expand Up @@ -337,7 +337,7 @@ function testTopicPermissions(topicName) {
/**
* TODO(developer): Uncomment the following line to run the sample.
*/
// const topicName = 'your-topic';
// const topicName = 'my-topic';

const permissionsToTest = [
`pubsub.topics.attachSubscription`,
Expand Down

0 comments on commit 109bd40

Please sign in to comment.