googlearchive / cloud-functions-go

Unofficial Native Go Runtime for Google Cloud Functions
Apache License 2.0
423 stars 44 forks source link

Pass through the file descriptors with options denoting what they are for #5

Closed salrashid123 closed 7 years ago

salrashid123 commented 7 years ago

Right now the runtime binary is executed with the file descriptors as positional arguments and the application runtime has to check/interpret what the FD's are for.

Suggest adding in options to args for the parameter's intents

execv(bin, const_cast<char* const*>(&args[0]));

eg. instead of ./main file_descriptor

you'd get

./main --listenfd file_descriptor

that way, i can opt-parse the arguments in main.go if i wanted to extend it.