Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

Can I execute code on Google Drive server infra?

Does Google Drive API provide a way to execute my code on the Google Drive server infra?

Let's say I want to write Google Dirve based grep to let customer search through thier files. I want to be able to write something like this: (very simplified to make it short)

/* define the function for grep */
var grep = function(params, callback) {
  // 1) find all text files using `gapi.client.drive.files.list`
  // 2) open each file with `gapi.client.drive.files.get`
  // 3) scan for the serach string occurance
  callback(search_result);
}

/* register the code on the server with imaginary API */
gapi.client.drive.server.register('myapp.grep', grep);

/* execute from Browser */
gapi.client.drive.server.myapp.grep({searchString: 'Abrakadabra', mimeType: 'application/javascript'},
  function(resutls) {
    console.log(results)
  }
);

There are tons of application types can take advantage of this approach. Simple DB manager is another example.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is Google Apps Script and Google App Engine which is quiet close to what you want. I don't think Google Drive has that feature.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...