-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for Go functions (#2929)
* feat: add local functions proxy * refactor: pass raw context to runtimes * feat: add support for Go functions * chore: fix linting errors * chore: update shrinkwrap * feat: use .exe extension for compiled binary on Windows * feat: add check for Go installation * chore: add pause call to test * feat: add local functions proxy * refactor: pass raw context to runtimes * feat: add support for Go functions * chore: fix linting errors * feat: use .exe extension for compiled binary on Windows * feat: add check for Go installation * chore: add pause call to test * chore: update shrinkwrap * chore: update shrinkwrap
- Loading branch information
1 parent
08d03db
commit 838e5bd
Showing
9 changed files
with
497 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { getBinaryPath: getFunctionsProxyPath } = require('@netlify/local-functions-proxy') | ||
const execa = require('execa') | ||
|
||
const runFunctionsProxy = ({ binaryPath, directory, name, requestData, timeout }) => { | ||
const functionsProxyPath = getFunctionsProxyPath() | ||
|
||
if (functionsProxyPath === null) { | ||
throw new Error('Host machine does not support local functions proxy server') | ||
} | ||
|
||
return execa(functionsProxyPath, [JSON.stringify(requestData), binaryPath, directory, name, `${timeout}s`]) | ||
} | ||
|
||
module.exports = { runFunctionsProxy } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
838e5bd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Benchmark results
Package size: 331 MB