Skip to content

Commit 142f56c

Browse files
author
Benjamin E. Coe
authored
feat: add .repo-metadata.json, start generating README.md (#636)
1 parent 884711f commit 142f56c

File tree

8 files changed

+117
-150
lines changed

8 files changed

+117
-150
lines changed

.cloud-repo-tools.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ system-test/*key.json
1313
.DS_Store
1414
google-cloud-logging-winston-*.tgz
1515
google-cloud-logging-bunyan-*.tgz
16+
__pycache__

.readme-partials.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
introduction: |-
2+
[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows
3+
you to send and receive messages between independent applications.

.repo-metadata.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "pubsub",
3+
"name_pretty": "Google Cloud Pub/Sub",
4+
"product_documentation": "https://cloud.google.com/pubsub/docs/",
5+
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/pubsub/latest/",
6+
"issue_tracker": "https://issuetracker.google.com/savedsearches/559741",
7+
"release_level": "beta",
8+
"language": "nodejs",
9+
"repo": "googleapis/nodejs-pubsub",
10+
"distribution_name": "@google-cloud/pubsub",
11+
"api_id": "pubsub.googleapis.com",
12+
"requires_billing": true
13+
}

README.md

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,59 @@
11
[//]: # "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`."
33
<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"/>
44

55
# [Google Cloud Pub/Sub: Node.js Client](https://github.com/googleapis/nodejs-pubsub)
66

7-
[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
7+
[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
88
[![npm version](https://img.shields.io/npm/v/@google-cloud/pubsub.svg)](https://www.npmjs.org/package/@google-cloud/pubsub)
99
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-pubsub/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-pubsub)
1010

11-
[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.
1211

1312

14-
* [Using the client library](#using-the-client-library)
13+
14+
[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows
15+
you to send and receive messages between independent applications.
16+
17+
18+
* [Google Cloud Pub/Sub Node.js Client API Reference][client-docs]
19+
* [Google Cloud Pub/Sub Documentation][product-docs]
20+
* [github.com/googleapis/nodejs-pubsub](https://github.com/googleapis/nodejs-pubsub)
21+
22+
Read more about the client libraries for Cloud APIs, including the older
23+
Google APIs Client Libraries, in [Client Libraries Explained][explained].
24+
25+
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
26+
27+
**Table of contents:**
28+
29+
30+
* [Quickstart](#quickstart)
31+
* [Before you begin](#before-you-begin)
32+
* [Installing the client library](#installing-the-client-library)
33+
* [Using the client library](#using-the-client-library)
1534
* [Samples](#samples)
1635
* [Versioning](#versioning)
1736
* [Contributing](#contributing)
1837
* [License](#license)
1938

20-
## Using the client library
39+
## Quickstart
2140

22-
1. [Select or create a Cloud Platform project][projects].
41+
### Before you begin
2342

43+
1. [Select or create a Cloud Platform project][projects].
2444
1. [Enable billing for your project][billing].
25-
2645
1. [Enable the Google Cloud Pub/Sub API][enable_api].
27-
2846
1. [Set up authentication with a service account][auth] so you can access the
2947
API from your local workstation.
3048

31-
1. Install the client library:
49+
### Installing the client library
50+
51+
```bash
52+
npm install @google-cloud/pubsub
53+
```
3254

33-
npm install --save @google-cloud/pubsub
3455

35-
1. Try an example:
56+
### Using the client library
3657

3758
```javascript
3859
// Imports the Google Cloud client library
@@ -49,30 +70,41 @@ async function quickstart(
4970
const [topic] = await pubsub.createTopic(topicName);
5071
console.log(`Topic ${topic.name} created.`);
5172
}
73+
5274
```
5375

76+
77+
5478
## Samples
5579

5680
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree/master/samples) directory. The samples' `README.md`
5781
has instructions for running the samples.
5882

5983
| Sample | Source Code | Try it |
6084
| --------------------------- | --------------------------------- | ------ |
85+
| Quickstart | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/quickstart.js) | [![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) |
6186
| Subscriptions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/subscriptions.js) | [![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) |
6287
| Topics | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/topics.js) | [![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) |
6388

64-
The [Cloud Pub/Sub Node.js Client API Reference][client-docs] documentation
89+
90+
91+
The [Google Cloud Pub/Sub Node.js Client API Reference][client-docs] documentation
6592
also contains samples.
6693

6794
## Versioning
6895

6996
This library follows [Semantic Versioning](http://semver.org/).
7097

98+
99+
71100
This library is considered to be in **beta**. This means it is expected to be
72101
mostly stable while we work toward a general availability release; however,
73102
complete stability is not guaranteed. We will address issues and requests
74103
against beta libraries with a high priority.
75104

105+
106+
107+
76108
More Information: [Google Cloud Platform Launch Stages][launch_stages]
77109

78110
[launch_stages]: https://cloud.google.com/terms/launch-stages
@@ -87,21 +119,10 @@ Apache Version 2.0
87119

88120
See [LICENSE](https://github.com/googleapis/nodejs-pubsub/blob/master/LICENSE)
89121

90-
## What's Next
91-
92-
* [Cloud Pub/Sub Documentation][product-docs]
93-
* [Cloud Pub/Sub Node.js Client API Reference][client-docs]
94-
* [github.com/googleapis/nodejs-pubsub](https://github.com/googleapis/nodejs-pubsub)
95-
96-
Read more about the client libraries for Cloud APIs, including the older
97-
Google APIs Client Libraries, in [Client Libraries Explained][explained].
98-
99-
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
100-
101-
[client-docs]: https://cloud.google.com/nodejs/docs/reference/pubsub/latest
102-
[product-docs]: https://cloud.google.com/pubsub/docs
122+
[client-docs]: https://cloud.google.com/nodejs/docs/reference/pubsub/latest/
123+
[product-docs]: https://cloud.google.com/pubsub/docs/
103124
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
104125
[projects]: https://console.cloud.google.com/project
105126
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
106127
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com
107-
[auth]: https://cloud.google.com/docs/authentication/getting-started
128+
[auth]: https://cloud.google.com/docs/authentication/getting-started

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"predocs": "npm run compile",
4040
"docs": "jsdoc -c .jsdoc.js",
4141
"fix": "eslint --fix '**/*.js' && gts fix",
42-
"generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json",
4342
"clean": "gts clean",
4443
"compile": "tsc -p . && cp -r src/v1 build/src/ && cp -r protos build/ && cp -r proto build/ && cp smoke-test/*.js build/system-test && cp test/*.js build/test",
4544
"prepare": "npm run compile",

samples/README.md

Lines changed: 48 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,81 @@
11
[//]: # "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`."
33
<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"/>
44

5-
# Google Cloud Pub/Sub: Node.js Samples
5+
# [Google Cloud Pub/Sub: Node.js Samples](https://github.com/googleapis/nodejs-pubsub)
66

77
[![Open in Cloud Shell][shell_img]][shell_link]
88

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.
1011

1112
## Table of Contents
1213

1314
* [Before you begin](#before-you-begin)
1415
* [Samples](#samples)
16+
* [Quickstart](#quickstart)
1517
* [Subscriptions](#subscriptions)
1618
* [Topics](#topics)
1719

1820
## Before you begin
1921

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).
2324

2425
## Samples
2526

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+
2646
### Subscriptions
2747

28-
View the [source code][subscriptions_0_code].
48+
View the [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/subscriptions.js).
2949

3050
[![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)
3151

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+
7962

8063
### Topics
8164

82-
View the [source code][topics_1_code].
65+
View the [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/topics.js).
8366

8467
[![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)
8568

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+
12678

12779
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
12880
[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/

synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-05-24T11:19:37.761336Z",
2+
"updateTime": "2019-06-05T14:48:21.972507Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.20.0",
8-
"dockerImage": "googleapis/artman@sha256:3246adac900f4bdbd62920e80de2e5877380e44036b3feae13667ec255ebf5ec"
7+
"version": "0.23.1",
8+
"dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "0537189470f04f24836d6959821c24197a0ed120",
16-
"internalRef": "249742806"
15+
"sha": "47c142a7cecc6efc9f6f8af804b8be55392b795b",
16+
"internalRef": "251635729"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)