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

Method Install

internal/pluginstore/install.go:47–66  ·  view source on GitHub ↗
(ctx context.Context, plugin Plugin, options InstallOptions)

Source from the content-addressed store, hash-verified

45}
46
47func (c Client) Install(ctx context.Context, plugin Plugin, options InstallOptions) (InstallResult, error) {
48 if errValidate := ValidatePlugin(plugin); errValidate != nil {
49 return InstallResult{}, errValidate
50 }
51 options = normalizeInstallOptions(options)
52 if PluginInstallType(plugin) == InstallTypeDirect {
53 plugin.Version = normalizeVersion(plugin.Version)
54 return c.InstallDirect(ctx, plugin, plugin.Install, options)
55 }
56 release, errRelease := c.FetchLatestRelease(ctx, plugin)
57 if errRelease != nil {
58 return InstallResult{}, errRelease
59 }
60 latestVersion, errVersion := ReleaseVersion(release)
61 if errVersion != nil {
62 return InstallResult{}, errVersion
63 }
64 plugin.Version = latestVersion
65 return c.installRelease(ctx, plugin, release, latestVersion, options)
66}
67
68func (c Client) InstallManifest(ctx context.Context, manifest Manifest, options InstallOptions) (InstallResult, error) {
69 if errValidate := manifest.Validate(); errValidate != nil {

Calls 8

InstallDirectMethod · 0.95
FetchLatestReleaseMethod · 0.95
installReleaseMethod · 0.95
normalizeInstallOptionsFunction · 0.85
normalizeVersionFunction · 0.85
ValidatePluginFunction · 0.70
PluginInstallTypeFunction · 0.70
ReleaseVersionFunction · 0.70