INNER CODE UNIT · Go
NewContainerModule
openrundev/openrun · plugins/container.go:46
func NewContainerModule() sdk.Module {
return &containerModule{}
}
func (c *containerModule) InitModule(ctx context.Context, init sdk.ModuleInit) error {
return nil
}
func (c *containerModule) Close(ctx context.Context) error {
return nil
}
// Run executes a command inside the app's container. It needs the request's
// container handler from the host process, so the container module is
// host-bound: it only works compiled into the OpenRun binary.
func (c *containerModule) Run(ctx context.Context, call *sdk.Call) (any, error) {
if call.Host == nil {
return nil, errors.New("container.run requires the compiled-in container plugin")