gcf.cr icon indicating copy to clipboard operation
gcf.cr copied to clipboard

RFC: gcloud attribute API

Open sam0x17 opened this issue 5 years ago • 0 comments

Right now it is necessary to use the command line parameters and/or information obtained directly from gcloud to determine the function memory, trigger type, function name, gcp project ID, etc. Now that we have a crystal-based API, we could better specify this information directly within the cloud function source code. I'm thinking something like this:

require "gcf"

class MyFunction < GCF::CloudFunction
  function_memory "256 MB"
  project_id "some_project"
  trigger_type :http

  def run(params : JSON::Any)
    # your function code here
  end
end

etc.

Thoughts?

sam0x17 avatar Jul 17 '18 20:07 sam0x17