MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / installManifest

Function installManifest

internal/homeplugins/sync.go:193–211  ·  view source on GitHub ↗
(ctx context.Context, client sdkpluginstore.Client, manifest sdkpluginstore.Manifest, root string, platform Platform, pluginRuntime PluginRuntime)

Source from the content-addressed store, hash-verified

191}
192
193func installManifest(ctx context.Context, client sdkpluginstore.Client, manifest sdkpluginstore.Manifest, root string, platform Platform, pluginRuntime PluginRuntime) (sdkpluginstore.InstallResult, error) {
194 id := strings.TrimSpace(manifest.ID)
195 if id == "" {
196 return sdkpluginstore.InstallResult{}, fmt.Errorf("home plugins: manifest plugin id is empty")
197 }
198 pluginIsBusy := func() bool {
199 return pluginRuntime != nil && pluginRuntime.PluginBusy(id)
200 }
201 result, errInstall := client.InstallManifest(ctx, manifest, sdkpluginstore.InstallOptions{
202 PluginsDir: root,
203 GOOS: platform.GOOS,
204 GOARCH: platform.GOARCH,
205 PluginLoaded: pluginIsBusy,
206 })
207 if errInstall != nil {
208 return sdkpluginstore.InstallResult{}, fmt.Errorf("home plugins: install %s: %w", id, errInstall)
209 }
210 return result, nil
211}
212
213func DeleteWithReport(ctx context.Context, cfg *config.Config, pluginRuntime PluginRuntime, taskID uint, pluginID string) SyncReport {
214 _ = ctx

Callers 1

SyncPlatformWithReportFunction · 0.85

Calls 2

PluginBusyMethod · 0.65
InstallManifestMethod · 0.45

Tested by

no test coverage detected