|
1 | 1 | [//]: # "This README.md file is auto-generated, all changes to this file will be lost." |
2 | | -[//]: # "To regenerate it, use `npm run generate-scaffolding`." |
| 2 | +[//]: # "To regenerate it, use `python -m synthtool`." |
3 | 3 | <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/> |
4 | 4 |
|
5 | | -# Google Cloud Pub/Sub: Node.js Samples |
| 5 | +# [Google Cloud Pub/Sub: Node.js Samples](https://github.com/googleapis/nodejs-pubsub) |
6 | 6 |
|
7 | 7 | [![Open in Cloud Shell][shell_img]][shell_link] |
8 | 8 |
|
9 | | -[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. |
| 9 | +[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows |
| 10 | +you to send and receive messages between independent applications. |
10 | 11 |
|
11 | 12 | ## Table of Contents |
12 | 13 |
|
13 | 14 | * [Before you begin](#before-you-begin) |
14 | 15 | * [Samples](#samples) |
| 16 | + * [Quickstart](#quickstart) |
15 | 17 | * [Subscriptions](#subscriptions) |
16 | 18 | * [Topics](#topics) |
17 | 19 |
|
18 | 20 | ## Before you begin |
19 | 21 |
|
20 | | -Before running the samples, make sure you've followed the steps in the |
21 | | -[Before you begin section](../README.md#before-you-begin) of the client |
22 | | -library's README. |
| 22 | +Before running the samples, make sure you've followed the steps outlined in |
| 23 | +[Using the client library](https://github.com/googleapis/nodejs-pubsub#using-the-client-library). |
23 | 24 |
|
24 | 25 | ## Samples |
25 | 26 |
|
| 27 | + |
| 28 | + |
| 29 | +### Quickstart |
| 30 | + |
| 31 | +View the [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/quickstart.js). |
| 32 | + |
| 33 | +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
| 34 | + |
| 35 | +__Usage:__ |
| 36 | + |
| 37 | + |
| 38 | +`node quickstart.js` |
| 39 | + |
| 40 | + |
| 41 | +----- |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
26 | 46 | ### Subscriptions |
27 | 47 |
|
28 | | -View the [source code][subscriptions_0_code]. |
| 48 | +View the [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/subscriptions.js). |
29 | 49 |
|
30 | 50 | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/subscriptions.js,samples/README.md) |
31 | 51 |
|
32 | | -__Usage:__ `node subscriptions.js --help` |
33 | | - |
34 | | -``` |
35 | | -subscriptions.js <command> |
36 | | -
|
37 | | -Commands: |
38 | | - subscriptions.js list [topicName] Lists all subscriptions in the current project, |
39 | | - optionally filtering by a topic. |
40 | | - subscriptions.js create <topicName> <subscriptionName> Creates a new subscription. |
41 | | - subscriptions.js create-flow <topicName> <subscriptionName> Creates a new subscription with flow-control limits, |
42 | | - which don't persist between subscriptions. |
43 | | - subscriptions.js create-push <topicName> <subscriptionName> Creates a new push subscription. |
44 | | - subscriptions.js modify-config <topicName> Modifies the configuration of an existing push |
45 | | - <subscriptionName> subscription. |
46 | | - subscriptions.js delete <subscriptionName> Deletes a subscription. |
47 | | - subscriptions.js get <subscriptionName> Gets the metadata for a subscription. |
48 | | - subscriptions.js listen-messages <subscriptionName> Listens to messages for a subscription. |
49 | | - subscriptions.js listen-errors <subscriptionName> Listens to messages and errors for a subscription. |
50 | | - subscriptions.js get-policy <subscriptionName> Gets the IAM policy for a subscription. |
51 | | - subscriptions.js set-policy <subscriptionName> Sets the IAM policy for a subscription. |
52 | | - subscriptions.js test-permissions <subscriptionName> Tests the permissions for a subscription. |
53 | | -
|
54 | | -Options: |
55 | | - --version Show version number [boolean] |
56 | | - --help Show help [boolean] |
57 | | -
|
58 | | -Examples: |
59 | | - node subscriptions.js list |
60 | | - node subscriptions.js list my-topic |
61 | | - node subscriptions.js create my-topic worker-1 |
62 | | - node subscriptions.js create-flow my-topic worker-1 -m 5 |
63 | | - node subscriptions.js create-push my-topic worker-1 |
64 | | - node subscriptions.js modify-config my-topic worker-1 |
65 | | - node subscriptions.js get worker-1 |
66 | | - node subscriptions.js listen-messages my-subscription |
67 | | - node subscriptions.js listen-errors my-subscription |
68 | | - node subscriptions.js delete worker-1 |
69 | | - node subscriptions.js pull worker-1 |
70 | | - node subscriptions.js get-policy worker-1 |
71 | | - node subscriptions.js set-policy worker-1 |
72 | | - node subscriptions.js test-permissions worker-1 |
73 | | -
|
74 | | -For more information, see https://cloud.google.com/pubsub/docs |
75 | | -``` |
76 | | - |
77 | | -[subscriptions_0_docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/latest/pubsub/subscription |
78 | | -[subscriptions_0_code]: subscriptions.js |
| 52 | +__Usage:__ |
| 53 | + |
| 54 | + |
| 55 | +`node subscriptions.js` |
| 56 | + |
| 57 | + |
| 58 | +----- |
| 59 | + |
| 60 | + |
| 61 | + |
79 | 62 |
|
80 | 63 | ### Topics |
81 | 64 |
|
82 | | -View the [source code][topics_1_code]. |
| 65 | +View the [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/topics.js). |
83 | 66 |
|
84 | 67 | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/topics.js,samples/README.md) |
85 | 68 |
|
86 | | -__Usage:__ `node topics.js --help` |
87 | | - |
88 | | -``` |
89 | | -topics.js <command> |
90 | | -
|
91 | | -Commands: |
92 | | - topics.js list Lists all topics in the current project. |
93 | | - topics.js create <topicName> Creates a new topic. |
94 | | - topics.js delete <topicName> Deletes a topic. |
95 | | - topics.js publish <topicName> <message> Publishes a message to a topic. |
96 | | - topics.js publish-attributes <topicName> <message> Publishes a message with custom attributes to a Topic |
97 | | - topics.js publish-batch <topicName> <message> Publishes messages to a topic using custom batching settings. |
98 | | - topics.js publish-retry <projectId> <topicName> <message> Publishes a message to a topic with retry settings. |
99 | | - topics.js publish-ordered <topicName> <message> Publishes an ordered message to a topic. |
100 | | - topics.js get-policy <topicName> Gets the IAM policy for a topic. |
101 | | - topics.js set-policy <topicName> Sets the IAM policy for a topic. |
102 | | - topics.js test-permissions <topicName> Tests the permissions for a topic. |
103 | | -
|
104 | | -Options: |
105 | | - --version Show version number [boolean] |
106 | | - --help Show help [boolean] |
107 | | -
|
108 | | -Examples: |
109 | | - node topics.js list |
110 | | - node topics.js create my-topic |
111 | | - node topics.js delete my-topic |
112 | | - node topics.js publish my-topic "Hello, world!" |
113 | | - node topics.js publish my-topic '{"data":"Hello, world!"}' |
114 | | - node topics.js publish-attributes my-topic "Hello, world!" |
115 | | - node topics.js publish-ordered my-topic "Hello, world!" |
116 | | - node topics.js publish-batch my-topic "Hello, world!" -w 1000 |
117 | | - node topics.js get-policy greetings |
118 | | - node topics.js set-policy greetings |
119 | | - node topics.js test-permissions greetings |
120 | | -
|
121 | | -For more information, see https://cloud.google.com/pubsub/docs |
122 | | -``` |
123 | | - |
124 | | -[topics_1_docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub/latest/pubsub/topic |
125 | | -[topics_1_code]: topics.js |
| 69 | +__Usage:__ |
| 70 | + |
| 71 | + |
| 72 | +`node topics.js` |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
126 | 78 |
|
127 | 79 | [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png |
128 | 80 | [shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/README.md |
| 81 | +[product-docs]: https://cloud.google.com/pubsub/docs/ |
0 commit comments