(ctx context.Context, auth *coreauth.Auth, req coreexecutor.Request, opts coreexecutor.Options)
| 1590 | } |
| 1591 | |
| 1592 | func (a *executorAdapter) Execute(ctx context.Context, auth *coreauth.Auth, req coreexecutor.Request, opts coreexecutor.Options) (resp coreexecutor.Response, err error) { |
| 1593 | if a == nil || a.executor == nil || a.host.isPluginFused(a.pluginID) || !a.host.pluginIdentityCurrent(a.pluginID, a.path, a.version) { |
| 1594 | return coreexecutor.Response{}, fmt.Errorf("plugin executor %s is unavailable", a.Identifier()) |
| 1595 | } |
| 1596 | defer func() { |
| 1597 | if recovered := recover(); recovered != nil { |
| 1598 | a.host.fusePlugin(a.pluginID, "Executor.Execute", recovered) |
| 1599 | resp = coreexecutor.Response{} |
| 1600 | err = fmt.Errorf("plugin executor %s panic: %v", a.Identifier(), recovered) |
| 1601 | } |
| 1602 | }() |
| 1603 | |
| 1604 | prepared, errPrepare := a.prepareExecutorCall(req, opts) |
| 1605 | if errPrepare != nil { |
| 1606 | return coreexecutor.Response{}, errPrepare |
| 1607 | } |
| 1608 | pluginResp, errExecute := a.executor.Execute(ctx, buildExecutorRequest(a.host, a.provider, auth, prepared.req, prepared.opts)) |
| 1609 | if errExecute != nil { |
| 1610 | return coreexecutor.Response{}, errExecute |
| 1611 | } |
| 1612 | return coreexecutor.Response{ |
| 1613 | Payload: a.translateExecutorResponse(ctx, prepared, pluginResp.Payload, false, nil), |
| 1614 | Metadata: cloneAnyMap(pluginResp.Metadata), |
| 1615 | Headers: cloneHeader(pluginResp.Headers), |
| 1616 | }, nil |
| 1617 | } |
| 1618 | |
| 1619 | func (a *executorAdapter) ExecuteStream(ctx context.Context, auth *coreauth.Auth, req coreexecutor.Request, opts coreexecutor.Options) (result *coreexecutor.StreamResult, err error) { |
| 1620 | if a == nil || a.executor == nil || a.host.isPluginFused(a.pluginID) || !a.host.pluginIdentityCurrent(a.pluginID, a.path, a.version) { |
nothing calls this directly
no test coverage detected