INNER CODE UNIT · Go
func
openrundev/openrun · plugins/container.go:50
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")
}
ch := call.Host.Value(types.TL_CONTAINER_HANDLER)
if ch == nil {
return nil, errors.New("container config not initialized")