pre-golang-removal: snapshot before removing all golang integration (2026-05-01)

This commit is contained in:
Naeel
2026-05-01 11:42:24 +03:00
parent f1b0369737
commit 2b97a3dbc6
11 changed files with 970 additions and 32 deletions
+22
View File
@@ -0,0 +1,22 @@
package runtime
// BuildDeployArchive creates a deployment archive for a given language and code.
// For Node.js, it creates a zip with an ESM wrapper.
// For script languages (PHP, Ruby), it creates a zip with the correct entrypoint filename.
// For others, it returns the code as is.
func BuildDeployArchive(lang, code string) ([]byte, error) {
switch lang {
case "nodejs":
return BuildJSDeployZip(code)
case "php":
return BuildScriptZip(code, "main.php")
case "ruby":
return BuildScriptZip(code, "handler.rb")
case "python", "go", "perl": // Go is a special case handled in CreateFunction, but for archive purposes it's just the source.
return []byte(code), nil
default:
// Allow unknown languages but treat them as simple scripts.
// The environment itself will fail later if the language is truly unsupported.
return []byte(code), nil
}
}