Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing non working example with publish #471

Closed
wants to merge 1 commit into from
Closed

Fixing non working example with publish #471

wants to merge 1 commit into from

Conversation

khaosdoctor
Copy link

Publish example was not working, so I updated it to the new API (because I needed to read the source code to understand this part), so it's easier for us to use the docs.

Here's my code as an example:

publisher.js

const PubSub = require('@google-cloud/pubsub')
const chalk = require('chalk')

function run () {
  console.log(chalk.bold.cyan('Publishing Message...'))
  return PubSub().topic('my-topic').publisher().publish(new Buffer.from(process.argv.pop()))
    .then((results) => {
      console.log(`Message ${chalk.bold.green(results.shift())} published`)
      return results
    })
    .catch(console.error)
}

run()

Use it like node publisher.js <mydata>

Publish example was not working, so I updated it to the new API (because I needed to read the source code to understand this part), so it's easier for us to use the docs.

Here's my code as an example:

> publisher.js
```js
const PubSub = require('@google-cloud/pubsub')
const chalk = require('chalk')

function run () {
  console.log(chalk.bold.cyan('Publishing Message...'))
  return PubSub().topic('my-topic').publisher().publish(new Buffer.from(process.argv.pop()))
    .then((results) => {
      console.log(`Message ${chalk.bold.green(results.shift())} published`)
      return results
    })
    .catch(console.error)
}

run()
```

Use it like `node publisher.js <mydata>`
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@khaosdoctor
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@ace-n
Copy link
Contributor

ace-n commented Aug 31, 2017

Thanks for the PR - but I think #464 already addresses these changes, so I'm closing this for now.

Feel free to comment/reopen if that's not the case.

@ace-n ace-n closed this Aug 31, 2017
@khaosdoctor
Copy link
Author

Yeah! That's the stuff lol we even used the same variable names 🤣 thanks @ace-n!

@khaosdoctor khaosdoctor deleted the patch-1 branch September 1, 2017 00:05
NimJay pushed a commit that referenced this pull request Nov 11, 2022
ace-n pushed a commit that referenced this pull request Nov 11, 2022
unforced pushed a commit that referenced this pull request Nov 17, 2022
🤖 I have created a release *beep* *boop*
---


## [5.10.0](googleapis/nodejs-security-center@v5.9.0...v5.10.0) (2022-04-11)


### Features

* Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([#474](googleapis/nodejs-security-center#474)) ([b29893c](googleapis/nodejs-security-center@b29893c))
* Add next_steps field to finding's list of attributes ([#476](googleapis/nodejs-security-center#476)) ([326e8d2](googleapis/nodejs-security-center@326e8d2))
* AuditConfig for IAM v1 ([#470](googleapis/nodejs-security-center#470)) ([2ec070f](googleapis/nodejs-security-center@2ec070f))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants