Channel

Channel

Create a channel object to interact with a Cloud Storage channel.

Constructor

new Channel(id, resourceId)

Parameters:
Name Type Description
id string

The ID of the channel.

resourceId string

The resource ID of the channel.

Source:
See:
Example
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const channel = storage.channel('id', 'resource-id');

Methods

stop(callbackopt) → {Promise.<StopResponse>}

Stop this channel.

Parameters:
Name Type Attributes Description
callback StopCallback <optional>

Callback function.

Source:
Example
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const channel = storage.channel('id', 'resource-id');
channel.stop(function(err, apiResponse) {
  if (!err) {
    // Channel stopped successfully.
  }
});

//-
// If the callback is omitted, we'll return a Promise.
//-
channel.stop().then(function(data) {
  const apiResponse = data[0];
});