Skip to content

Commit

Permalink
DLP library (GAPIC-only) (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesneeringer authored and stephenplusplus committed Jun 4, 2017
1 parent 4ab2875 commit ba25793
Show file tree
Hide file tree
Showing 9 changed files with 1,128 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/dlp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Node.js Client for DLP API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-node#versioning))

[DLP API][Product Documentation]: The Google Data Loss Prevention API provides methods for detection of privacy-sensitive fragments in text, images, and Google Cloud Platform storage repositories.
- [Client Library Documentation][]
- [Product Documentation][]

## Quick Start
In order to use this library, you first need to go through the following steps:

1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
2. [Enable the DLP API.](https://console.cloud.google.com/apis/api/dlp)
3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/master/guides/authentication)

### Installation
```
$ npm install --save @google-cloud/dlp
```

### Next Steps
- Read the [Client Library Documentation][] for DLP API to see other available methods on the client.
- Read the [DLP API Product documentation][Product Documentation] to learn more about the product and see How-to Guides.
- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/README.md) to see the full list of Cloud APIs that we cover.

[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/dlp
[Product Documentation]: https://cloud.google.com/dlp
44 changes: 44 additions & 0 deletions packages/dlp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"repository": "GoogleCloudPlatform/google-cloud-node",
"name": "@google-cloud/dlp",
"version": "0.0.0",
"author": "Google Inc",
"description": "DLP API client for Node.js",
"main": "src/index.js",
"files": [
"src",
"AUTHORS",
"CONTRIBUTING",
"COPYING"
],
"keywords": [
"google apis client",
"google api client",
"google apis",
"google api",
"google",
"google cloud platform",
"google cloud",
"cloud",
"google dlp",
"dlp",
"DLP API"
],
"dependencies": {
"google-proto-files": "^0.12.0",
"google-gax": "^0.13.2",
"extend": "^3.0.0"
},
"devDependencies": {
"mocha": "^3.2.0",
"through2": "^2.0.3"
},
"scripts": {
"test": "mocha",
"publish-module": "node ../../scripts/publish.js dlp"
},
"license": "Apache-2.0",
"engines": {
"node": ">=4.0.0"
}
}
55 changes: 55 additions & 0 deletions packages/dlp/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2017, Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';

var extend = require('extend');
var gapic = {
v2beta1: require('./v2beta1')
};

const VERSION = require('../package.json').version;

/**
* Create an dlpServiceClient with additional helpers for common
* tasks.
*
* The DLP API is a service that allows clients
* to detect the presence of Personally Identifiable Information (PII) and other
* privacy-sensitive data in user-supplied, unstructured data streams, like text
* blocks or images.
* The service also includes methods for sensitive data redaction and
* scheduling of data scans on Google Cloud Platform based data sets.
*
* @param {object=} options - [Configuration object](#/docs).
* @param {number=} options.port - The port on which to connect to
* the remote host.
* @param {string=} options.servicePath - The domain name of the
* API remote host.
*/
function dlpV2beta1(options) {
// Define the header options.
options = extend({}, options, {
libName: 'gccl',
libVersion: VERSION
});

// Create the image annotator client with the provided options.
var client = gapic.v2beta1(options).dlpServiceClient(options);
return client;
}

module.exports = dlpV2beta1;
module.exports.v2beta1 = dlpV2beta1;
Loading

0 comments on commit ba25793

Please sign in to comment.