MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / NewPlugin

Function NewPlugin

internal/plugins/command-runner/plugin.go:16–29  ·  view source on GitHub ↗

NewPlugin creates a new command runner plugin

(config Config, sshClient SSHClient, apiClient ProxmoxAPIClient, app UIApp)

Source from the content-addressed store, hash-verified

14
15// NewPlugin creates a new command runner plugin
16func NewPlugin(config Config, sshClient SSHClient, apiClient ProxmoxAPIClient, app UIApp) (*Plugin, error) {
17 if err := config.Validate(); err != nil {
18 return nil, fmt.Errorf("invalid config: %w", err)
19 }
20
21 executor := NewExecutor(config, sshClient, apiClient)
22 uiManager := NewUIManager(app, executor)
23
24 return &Plugin{
25 config: config,
26 executor: executor,
27 uiManager: uiManager,
28 }, nil
29}
30
31// Name returns the plugin name
32func (p *Plugin) Name() string {

Callers

nothing calls this directly

Calls 3

NewExecutorFunction · 0.85
NewUIManagerFunction · 0.85
ValidateMethod · 0.45

Tested by

no test coverage detected