NewPlugin creates a new command runner plugin
(config Config, sshClient SSHClient, apiClient ProxmoxAPIClient, app UIApp)
| 14 | |
| 15 | // NewPlugin creates a new command runner plugin |
| 16 | func 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 |
| 32 | func (p *Plugin) Name() string { |
nothing calls this directly
no test coverage detected