A Go tool to safely compile and run Go programs by only allowing importing of whitelisted packages.
If you are not careful, running in parallell might let the child processes execute arbitrary code: https://github.com/zond/gosafe/issues/1
To enable running any piece of Go code (even if it comes from unknown sources) with ease and safety.
Compiler.Allow to allow given packages, then run code with
Communicating with child processes
child.Stderr() in https://github.com/zond/gosafe/blob/master/child/child.go to communicate with the child processes via structured data.
On demand child processes
gosafe.Cmd#Handle to create child process handlers that will stay dormant until needed (when
gosafe.Cmd#Handle is called), and die again after a customizable timeout without new messages.
See https://github.com/zond/gosafe/tree/master/examples/spinner for an example.
On demand child processes with transparent method calling and callbacks to the mother process
child.Server#Start to create child processes serving many different types of calls from the parent process.
gosafe.Cmd#Register to register callbacks that the child processes can use to access data outside their runtime (such as private persistence providers for example) before responding with their final return value.
See https://github.com/zond/gosafe/blob/master/examples/server/server.go for an example.