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

docs: var storage -> var gcs; #664

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ var gcloud = require('gcloud');
// Authorizing on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authorization section above).

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

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

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

// Upload a local file to a new file to be created in your bucket.
var fileStream = fs.createReadStream('/local/file.txt');
Expand Down
8 changes: 4 additions & 4 deletions docs/site/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ <h4>Example: Upload a file to Cloud Storage</h4>
projectId: 'grape-spaceship-123'
});

var storage = gcloud.storage();
var gcs = gcloud.storage();

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

var storage = gcloud.storage();
var gcs = gcloud.storage();

var backups = storage.bucket('backups');
var backups = gcs.bucket('backups');
backups.upload('db.zip', function(err, file) {
// file.createReadStream();
// file.getMetadata();
Expand Down
18 changes: 9 additions & 9 deletions lib/bigquery/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ Table.prototype.delete = function(callback) {
* @throws {Error} If destination format isn't recongized.
*
* @example
* var storage = gcloud.storage({
* var gcs = gcloud.storage({
* projectId: 'grape-spaceship-123'
* });
* var exportedFile = storage.bucket('institutions').file('2014.csv');
* var exportedFile = gcs.bucket('institutions').file('2014.csv');
*
* //-
* // To use the default options, just pass a {module:storage/file} object.
Expand All @@ -397,8 +397,8 @@ Table.prototype.delete = function(callback) {
* // You can also specify multiple destination files.
* //-
* table.export([
* storage.bucket('institutions').file('2014.json'),
* storage.bucket('institutions-copy').file('2014.json')
* gcs.bucket('institutions').file('2014.json'),
* gcs.bucket('institutions-copy').file('2014.json')
* ], options, function(err, job, apiResponse) {});
*/
Table.prototype.export = function(destination, options, callback) {
Expand Down Expand Up @@ -606,17 +606,17 @@ Table.prototype.getRows = function(options, callback) {
* table.import('./my-data.csv', metadata, function(err, job, apiResponse) {});
*
* //-
* // Load data from a file in your Storage bucket.
* // Load data from a file in your Cloud Storage bucket.
* //-
* var data = storage.bucket('institutions').file('data.csv');
* var data = gcs.bucket('institutions').file('data.csv');
* table.import(data, function(err, job, apiResponse) {});
*
* //-
* // Load data from multiple files in your Storage bucket(s).
* // Load data from multiple files in your Cloud Storage bucket(s).
* //-
* table.import([
* storage.bucket('institutions').file('2011.csv'),
* storage.bucket('institutions').file('2012.csv')
* gcs.bucket('institutions').file('2011.csv'),
* gcs.bucket('institutions').file('2012.csv')
* ], function(err, job, apiResponse) {});
*/
Table.prototype.import = function(source, metadata, callback) {
Expand Down
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ var util = require('./common/util.js');
* // projectId: 'my-project'
* // });
*
* var storage = gcloud.storage();
* var bucket = storage.bucket({
* var gcs = gcloud.storage();
* var bucket = gcs.bucket({
* name: 'PhotosBucket',
* // properties may be overridden:
* keyFilename: '/path/to/other/keyfile.json'
Expand Down Expand Up @@ -205,7 +205,7 @@ gcloud.pubsub = function(config) {
*
* @example
* var gcloud = require('gcloud');
* var storage = gcloud.storage({
* var gcs = gcloud.storage({
* projectId: 'project-id',
* keyFilename: '/path/to/keyfile.json'
* });
Expand Down
20 changes: 10 additions & 10 deletions lib/storage/acl.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ function Acl(options) {
* @return {object}
*
* @example
* var storage = gcloud.storage({
* var gcs = gcloud.storage({
* projectId: 'grape-spaceship-123'
* });
*
* //-
* // Add a user as an owner of a file.
* //-
* var myBucket = storage.bucket('my-bucket');
* var myBucket = gcs.bucket('my-bucket');
* var myFile = myBucket.file('my-file');
* myFile.acl.owners.addUser('email@example.com', function(err, aclObject) {});
*
Expand All @@ -115,7 +115,7 @@ function Acl(options) {
* //-
* myFile.acl.add({
* entity: 'user-email@example.com',
* role: storage.acl.OWNER_ROLE
* role: gcs.acl.OWNER_ROLE
* }, function(err, aclObject) {});
*/
Acl.prototype.owners = {};
Expand Down Expand Up @@ -154,7 +154,7 @@ Acl.prototype.owners = {};
* //-
* myFile.acl.add({
* entity: 'user-email@example.com',
* role: storage.acl.READER_ROLE
* role: gcs.acl.READER_ROLE
* }, function(err, aclObject) {});
*/
Acl.prototype.readers = {};
Expand Down Expand Up @@ -193,7 +193,7 @@ Acl.prototype.readers = {};
* //-
* myFile.acl.add({
* entity: 'user-email@example.com',
* role: storage.acl.WRITER_ROLE
* role: gcs.acl.WRITER_ROLE
* }, function(err, aclObject) {});
*/
Acl.prototype.writers = {};
Expand All @@ -216,7 +216,7 @@ nodeutil.inherits(Acl, AclRoleAccessorMethods);
* @example
* myBucket.acl.add({
* entity: 'user-useremail@example.com',
* role: storage.acl.OWNER_ROLE
* role: gcs.acl.OWNER_ROLE
* }, function(err, aclObject, apiResponse) {});
*
* //-
Expand All @@ -226,7 +226,7 @@ nodeutil.inherits(Acl, AclRoleAccessorMethods);
* //-
* myFile.acl.add({
* entity: 'user-useremail@example.com',
* role: storage.acl.OWNER_ROLE,
* role: gcs.acl.OWNER_ROLE,
* generation: 1
* }, function(err, aclObject, apiResponse) {});
*/
Expand Down Expand Up @@ -383,21 +383,21 @@ Acl.prototype.get = function(options, callback) {
* @alias acl.update
*
* @example
* var storage = gcloud.storage({
* var gcs = gcloud.storage({
* projectId: 'grape-spaceship-123'
* });
*
* myBucket.acl.update({
* entity: 'user-useremail@example.com',
* role: storage.acl.WRITER_ROLE
* role: gcs.acl.WRITER_ROLE
* }, function(err, apiResponse) {});
*
* //-
* // For file ACL operations, you can also specify a `generation` property.
* //-
* myFile.acl.update({
* entity: 'user-useremail@example.com',
* role: storage.acl.WRITER_ROLE,
* role: gcs.acl.WRITER_ROLE,
* generation: 1
* }, function(err, apiResponse) {});
*/
Expand Down
12 changes: 6 additions & 6 deletions lib/storage/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ var RESUMABLE_THRESHOLD = 5000000;
* @example
* var gcloud = require('gcloud');
*
* var storage = gcloud.storage({
* var gcs = gcloud.storage({
* projectId: 'grape-spaceship-123'
* });
*
* var albums = storage.bucket('albums');
* var albums = gcs.bucket('albums');
*/
function Bucket(storage, name) {
this.metadata = {};
Expand Down Expand Up @@ -122,10 +122,10 @@ function Bucket(storage, name) {
* //-
* // Make a bucket's contents publicly readable.
* //-
* var myBucket = storage.bucket('my-bucket');
* var myBucket = gcs.bucket('my-bucket');
* myBucket.acl.add({
* scope: 'allUsers',
* role: storage.acl.READER_ROLE
* role: gcs.acl.READER_ROLE
* }, function(err, aclObject) {});
*/
this.acl = new Acl({
Expand Down Expand Up @@ -215,7 +215,7 @@ function Bucket(storage, name) {
* @param {function=} callback - The callback function.
*
* @example
* var logBucket = storage.bucket('log-bucket');
* var logBucket = gcs.bucket('log-bucket');
*
* var logs2013 = logBucket.file('2013-logs.txt');
* var logs2014 = logBucket.file('2014-logs.txt');
Expand Down Expand Up @@ -302,7 +302,7 @@ Bucket.prototype.combine = function(sources, destination, callback) {
* @param {function=} callback - The callback function.
*
* @example
* var bucket = storage.bucket('delete-me');
* var bucket = gcs.bucket('delete-me');
* bucket.delete(function(err, apiResponse) {});
*/
Bucket.prototype.delete = function(callback) {
Expand Down
16 changes: 8 additions & 8 deletions lib/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ function File(bucket, name, options) {
* //-
* // Make a file publicly readable.
* //-
* var storage = gcloud.storage({
* var gcs = gcloud.storage({
* projectId: 'grape-spaceship-123'
* });
*
* var myFile = storage.bucket('my-bucket').file('my-file');
* var myFile = gcs.bucket('my-bucket').file('my-file');
*
* myFile.acl.add({
* scope: 'allUsers',
* role: storage.acl.READER_ROLE
* role: gcs.acl.READER_ROLE
* }, function(err, aclObject) {});
*/
this.acl = new Acl({
Expand All @@ -142,7 +142,7 @@ function File(bucket, name, options) {
* // For all of the below examples, assume we are working with the following
* // Bucket and File objects.
* //-
* var bucket = storage.bucket('my-bucket');
* var bucket = gcs.bucket('my-bucket');
* var file = bucket.file('my-image.png');
*
* //-
Expand All @@ -162,7 +162,7 @@ function File(bucket, name, options) {
* // If you pass in a Bucket object, the file will be copied to that bucket
* // using the same name.
* //-
* var anotherBucket = storage.bucket('another-bucket');
* var anotherBucket = gcs.bucket('another-bucket');
* file.copy(anotherBucket, function(err, copiedFile, apiResponse) {
* // `my-bucket` still contains:
* // - "my-image.png"
Expand Down Expand Up @@ -266,7 +266,7 @@ File.prototype.copy = function(destination, callback) {
* // For all of the below examples, assume we are working with the following
* // Bucket and File objects.
* //-
* var bucket = storage.bucket('my-bucket');
* var bucket = gcs.bucket('my-bucket');
* var file = bucket.file('my-image.png');
*
* //-
Expand All @@ -287,7 +287,7 @@ File.prototype.copy = function(destination, callback) {
* // If you pass in a Bucket object, the file will be moved to that bucket
* // using the same name.
* //-
* var anotherBucket = storage.bucket('another-bucket');
* var anotherBucket = gcs.bucket('another-bucket');
*
* file.move(anotherBucket, function(err, destinationFile, apiResponse) {
* // `my-bucket` no longer contains:
Expand Down Expand Up @@ -373,7 +373,7 @@ File.prototype.move = function(destination, callback) {
* // backup of your remote data.
* //-
* var fs = require('fs');
* var myBucket = storage.bucket('my-bucket');
* var myBucket = gcs.bucket('my-bucket');
* var image = myBucket.file('image.png');
*
* image.createReadStream()
Expand Down
Loading