Skip to content

Commit 0822aaa

Browse files
committed
Merge pull request #664 from stephenplusplus/spp--docs-storage-to-gcs
docs: var storage -> var gcs;
2 parents d51c9a7 + 197c334 commit 0822aaa

File tree

8 files changed

+61
-61
lines changed

8 files changed

+61
-61
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,16 @@ var gcloud = require('gcloud');
174174
// Authorizing on a per-API-basis. You don't need to do this if you auth on a
175175
// global basis (see Authorization section above).
176176

177-
var storage = gcloud.storage({
177+
var gcs = gcloud.storage({
178178
keyFilename: '/path/to/keyfile.json',
179179
projectId: 'my-project'
180180
});
181181

182182
// Create a new bucket.
183-
storage.createBucket('my-new-bucket', function(err, bucket) {});
183+
gcs.createBucket('my-new-bucket', function(err, bucket) {});
184184

185185
// Reference an existing bucket.
186-
var bucket = storage.bucket('my-bucket');
186+
var bucket = gcs.bucket('my-bucket');
187187

188188
// Upload a local file to a new file to be created in your bucket.
189189
var fileStream = fs.createReadStream('/local/file.txt');

docs/site/home.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ <h4>Example: Upload a file to Cloud Storage</h4>
102102
projectId: 'grape-spaceship-123'
103103
});
104104

105-
var storage = gcloud.storage();
105+
var gcs = gcloud.storage();
106106

107-
var backups = storage.bucket('backups');
107+
var backups = gcs.bucket('backups');
108108
backups.upload('db.zip', function(err, file) {
109109
// file.createReadStream();
110110
// file.getMetadata();
@@ -118,9 +118,9 @@ <h4>Example: Upload a file to Cloud Storage</h4>
118118
keyFilename: '/path/to/keyfile.json'
119119
});
120120

121-
var storage = gcloud.storage();
121+
var gcs = gcloud.storage();
122122

123-
var backups = storage.bucket('backups');
123+
var backups = gcs.bucket('backups');
124124
backups.upload('db.zip', function(err, file) {
125125
// file.createReadStream();
126126
// file.getMetadata();

lib/bigquery/table.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,10 @@ Table.prototype.delete = function(callback) {
369369
* @throws {Error} If destination format isn't recongized.
370370
*
371371
* @example
372-
* var storage = gcloud.storage({
372+
* var gcs = gcloud.storage({
373373
* projectId: 'grape-spaceship-123'
374374
* });
375-
* var exportedFile = storage.bucket('institutions').file('2014.csv');
375+
* var exportedFile = gcs.bucket('institutions').file('2014.csv');
376376
*
377377
* //-
378378
* // To use the default options, just pass a {module:storage/file} object.
@@ -397,8 +397,8 @@ Table.prototype.delete = function(callback) {
397397
* // You can also specify multiple destination files.
398398
* //-
399399
* table.export([
400-
* storage.bucket('institutions').file('2014.json'),
401-
* storage.bucket('institutions-copy').file('2014.json')
400+
* gcs.bucket('institutions').file('2014.json'),
401+
* gcs.bucket('institutions-copy').file('2014.json')
402402
* ], options, function(err, job, apiResponse) {});
403403
*/
404404
Table.prototype.export = function(destination, options, callback) {
@@ -606,17 +606,17 @@ Table.prototype.getRows = function(options, callback) {
606606
* table.import('./my-data.csv', metadata, function(err, job, apiResponse) {});
607607
*
608608
* //-
609-
* // Load data from a file in your Storage bucket.
609+
* // Load data from a file in your Cloud Storage bucket.
610610
* //-
611-
* var data = storage.bucket('institutions').file('data.csv');
611+
* var data = gcs.bucket('institutions').file('data.csv');
612612
* table.import(data, function(err, job, apiResponse) {});
613613
*
614614
* //-
615-
* // Load data from multiple files in your Storage bucket(s).
615+
* // Load data from multiple files in your Cloud Storage bucket(s).
616616
* //-
617617
* table.import([
618-
* storage.bucket('institutions').file('2011.csv'),
619-
* storage.bucket('institutions').file('2012.csv')
618+
* gcs.bucket('institutions').file('2011.csv'),
619+
* gcs.bucket('institutions').file('2012.csv')
620620
* ], function(err, job, apiResponse) {});
621621
*/
622622
Table.prototype.import = function(source, metadata, callback) {

lib/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ var util = require('./common/util.js');
9595
* // projectId: 'my-project'
9696
* // });
9797
*
98-
* var storage = gcloud.storage();
99-
* var bucket = storage.bucket({
98+
* var gcs = gcloud.storage();
99+
* var bucket = gcs.bucket({
100100
* name: 'PhotosBucket',
101101
* // properties may be overridden:
102102
* keyFilename: '/path/to/other/keyfile.json'
@@ -205,7 +205,7 @@ gcloud.pubsub = function(config) {
205205
*
206206
* @example
207207
* var gcloud = require('gcloud');
208-
* var storage = gcloud.storage({
208+
* var gcs = gcloud.storage({
209209
* projectId: 'project-id',
210210
* keyFilename: '/path/to/keyfile.json'
211211
* });

lib/storage/acl.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ function Acl(options) {
9999
* @return {object}
100100
*
101101
* @example
102-
* var storage = gcloud.storage({
102+
* var gcs = gcloud.storage({
103103
* projectId: 'grape-spaceship-123'
104104
* });
105105
*
106106
* //-
107107
* // Add a user as an owner of a file.
108108
* //-
109-
* var myBucket = storage.bucket('my-bucket');
109+
* var myBucket = gcs.bucket('my-bucket');
110110
* var myFile = myBucket.file('my-file');
111111
* myFile.acl.owners.addUser('[email protected]', function(err, aclObject) {});
112112
*
@@ -115,7 +115,7 @@ function Acl(options) {
115115
* //-
116116
* myFile.acl.add({
117117
* entity: 'user-email@example.com',
118-
* role: storage.acl.OWNER_ROLE
118+
* role: gcs.acl.OWNER_ROLE
119119
* }, function(err, aclObject) {});
120120
*/
121121
Acl.prototype.owners = {};
@@ -154,7 +154,7 @@ Acl.prototype.owners = {};
154154
* //-
155155
* myFile.acl.add({
156156
* entity: 'user-email@example.com',
157-
* role: storage.acl.READER_ROLE
157+
* role: gcs.acl.READER_ROLE
158158
* }, function(err, aclObject) {});
159159
*/
160160
Acl.prototype.readers = {};
@@ -193,7 +193,7 @@ Acl.prototype.readers = {};
193193
* //-
194194
* myFile.acl.add({
195195
* entity: 'user-email@example.com',
196-
* role: storage.acl.WRITER_ROLE
196+
* role: gcs.acl.WRITER_ROLE
197197
* }, function(err, aclObject) {});
198198
*/
199199
Acl.prototype.writers = {};
@@ -216,7 +216,7 @@ nodeutil.inherits(Acl, AclRoleAccessorMethods);
216216
* @example
217217
* myBucket.acl.add({
218218
* entity: 'user-useremail@example.com',
219-
* role: storage.acl.OWNER_ROLE
219+
* role: gcs.acl.OWNER_ROLE
220220
* }, function(err, aclObject, apiResponse) {});
221221
*
222222
* //-
@@ -226,7 +226,7 @@ nodeutil.inherits(Acl, AclRoleAccessorMethods);
226226
* //-
227227
* myFile.acl.add({
228228
* entity: 'user-useremail@example.com',
229-
* role: storage.acl.OWNER_ROLE,
229+
* role: gcs.acl.OWNER_ROLE,
230230
* generation: 1
231231
* }, function(err, aclObject, apiResponse) {});
232232
*/
@@ -383,21 +383,21 @@ Acl.prototype.get = function(options, callback) {
383383
* @alias acl.update
384384
*
385385
* @example
386-
* var storage = gcloud.storage({
386+
* var gcs = gcloud.storage({
387387
* projectId: 'grape-spaceship-123'
388388
* });
389389
*
390390
* myBucket.acl.update({
391391
* entity: 'user-useremail@example.com',
392-
* role: storage.acl.WRITER_ROLE
392+
* role: gcs.acl.WRITER_ROLE
393393
* }, function(err, apiResponse) {});
394394
*
395395
* //-
396396
* // For file ACL operations, you can also specify a `generation` property.
397397
* //-
398398
* myFile.acl.update({
399399
* entity: 'user-useremail@example.com',
400-
* role: storage.acl.WRITER_ROLE,
400+
* role: gcs.acl.WRITER_ROLE,
401401
* generation: 1
402402
* }, function(err, apiResponse) {});
403403
*/

lib/storage/bucket.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ var RESUMABLE_THRESHOLD = 5000000;
7878
* @example
7979
* var gcloud = require('gcloud');
8080
*
81-
* var storage = gcloud.storage({
81+
* var gcs = gcloud.storage({
8282
* projectId: 'grape-spaceship-123'
8383
* });
8484
*
85-
* var albums = storage.bucket('albums');
85+
* var albums = gcs.bucket('albums');
8686
*/
8787
function Bucket(storage, name) {
8888
this.metadata = {};
@@ -122,10 +122,10 @@ function Bucket(storage, name) {
122122
* //-
123123
* // Make a bucket's contents publicly readable.
124124
* //-
125-
* var myBucket = storage.bucket('my-bucket');
125+
* var myBucket = gcs.bucket('my-bucket');
126126
* myBucket.acl.add({
127127
* scope: 'allUsers',
128-
* role: storage.acl.READER_ROLE
128+
* role: gcs.acl.READER_ROLE
129129
* }, function(err, aclObject) {});
130130
*/
131131
this.acl = new Acl({
@@ -215,7 +215,7 @@ function Bucket(storage, name) {
215215
* @param {function=} callback - The callback function.
216216
*
217217
* @example
218-
* var logBucket = storage.bucket('log-bucket');
218+
* var logBucket = gcs.bucket('log-bucket');
219219
*
220220
* var logs2013 = logBucket.file('2013-logs.txt');
221221
* var logs2014 = logBucket.file('2014-logs.txt');
@@ -302,7 +302,7 @@ Bucket.prototype.combine = function(sources, destination, callback) {
302302
* @param {function=} callback - The callback function.
303303
*
304304
* @example
305-
* var bucket = storage.bucket('delete-me');
305+
* var bucket = gcs.bucket('delete-me');
306306
* bucket.delete(function(err, apiResponse) {});
307307
*/
308308
Bucket.prototype.delete = function(callback) {

lib/storage/file.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ function File(bucket, name, options) {
107107
* //-
108108
* // Make a file publicly readable.
109109
* //-
110-
* var storage = gcloud.storage({
110+
* var gcs = gcloud.storage({
111111
* projectId: 'grape-spaceship-123'
112112
* });
113113
*
114-
* var myFile = storage.bucket('my-bucket').file('my-file');
114+
* var myFile = gcs.bucket('my-bucket').file('my-file');
115115
*
116116
* myFile.acl.add({
117117
* scope: 'allUsers',
118-
* role: storage.acl.READER_ROLE
118+
* role: gcs.acl.READER_ROLE
119119
* }, function(err, aclObject) {});
120120
*/
121121
this.acl = new Acl({
@@ -142,7 +142,7 @@ function File(bucket, name, options) {
142142
* // For all of the below examples, assume we are working with the following
143143
* // Bucket and File objects.
144144
* //-
145-
* var bucket = storage.bucket('my-bucket');
145+
* var bucket = gcs.bucket('my-bucket');
146146
* var file = bucket.file('my-image.png');
147147
*
148148
* //-
@@ -162,7 +162,7 @@ function File(bucket, name, options) {
162162
* // If you pass in a Bucket object, the file will be copied to that bucket
163163
* // using the same name.
164164
* //-
165-
* var anotherBucket = storage.bucket('another-bucket');
165+
* var anotherBucket = gcs.bucket('another-bucket');
166166
* file.copy(anotherBucket, function(err, copiedFile, apiResponse) {
167167
* // `my-bucket` still contains:
168168
* // - "my-image.png"
@@ -266,7 +266,7 @@ File.prototype.copy = function(destination, callback) {
266266
* // For all of the below examples, assume we are working with the following
267267
* // Bucket and File objects.
268268
* //-
269-
* var bucket = storage.bucket('my-bucket');
269+
* var bucket = gcs.bucket('my-bucket');
270270
* var file = bucket.file('my-image.png');
271271
*
272272
* //-
@@ -287,7 +287,7 @@ File.prototype.copy = function(destination, callback) {
287287
* // If you pass in a Bucket object, the file will be moved to that bucket
288288
* // using the same name.
289289
* //-
290-
* var anotherBucket = storage.bucket('another-bucket');
290+
* var anotherBucket = gcs.bucket('another-bucket');
291291
*
292292
* file.move(anotherBucket, function(err, destinationFile, apiResponse) {
293293
* // `my-bucket` no longer contains:
@@ -373,7 +373,7 @@ File.prototype.move = function(destination, callback) {
373373
* // backup of your remote data.
374374
* //-
375375
* var fs = require('fs');
376-
* var myBucket = storage.bucket('my-bucket');
376+
* var myBucket = gcs.bucket('my-bucket');
377377
* var image = myBucket.file('image.png');
378378
*
379379
* image.createReadStream()

0 commit comments

Comments
 (0)