plugins

package
v1.65.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuiltinCoderPlugin added in v1.60.0

type BuiltinCoderPlugin struct {
	// contains filtered or unexported fields
}

BuiltinCoderPlugin adapts the engine package to the Plugin interface, providing @coder functionality without requiring an external binary.

func NewBuiltinCoderPlugin added in v1.60.0

func NewBuiltinCoderPlugin() *BuiltinCoderPlugin

NewBuiltinCoderPlugin creates a builtin @coder plugin backed by the engine package.

func (*BuiltinCoderPlugin) Description added in v1.60.0

func (p *BuiltinCoderPlugin) Description() string

func (*BuiltinCoderPlugin) Execute added in v1.60.0

func (p *BuiltinCoderPlugin) Execute(ctx context.Context, args []string) (string, error)

Execute runs without streaming — collects all output and returns.

func (*BuiltinCoderPlugin) ExecuteWithStream added in v1.60.0

func (p *BuiltinCoderPlugin) ExecuteWithStream(ctx context.Context, args []string, onOutput func(string)) (string, error)

ExecuteWithStream runs the engine and streams output line-by-line via onOutput.

func (*BuiltinCoderPlugin) Name added in v1.60.0

func (p *BuiltinCoderPlugin) Name() string

func (*BuiltinCoderPlugin) Path added in v1.60.0

func (p *BuiltinCoderPlugin) Path() string

func (*BuiltinCoderPlugin) Schema added in v1.60.0

func (p *BuiltinCoderPlugin) Schema() string

func (*BuiltinCoderPlugin) Usage added in v1.60.0

func (p *BuiltinCoderPlugin) Usage() string

func (*BuiltinCoderPlugin) Version added in v1.60.0

func (p *BuiltinCoderPlugin) Version() string

type ExecutablePlugin

type ExecutablePlugin struct {
	// contains filtered or unexported fields
}

func (*ExecutablePlugin) Description

func (p *ExecutablePlugin) Description() string

func (*ExecutablePlugin) Execute

func (p *ExecutablePlugin) Execute(ctx context.Context, args []string) (string, error)

Execute mantém compatibilidade

func (*ExecutablePlugin) ExecuteWithStream added in v1.47.8

func (p *ExecutablePlugin) ExecuteWithStream(ctx context.Context, args []string, onOutput func(string)) (string, error)

ExecuteWithStream é a implementação real com callback

func (*ExecutablePlugin) Name

func (p *ExecutablePlugin) Name() string

func (*ExecutablePlugin) Path

func (p *ExecutablePlugin) Path() string

func (*ExecutablePlugin) Schema added in v1.38.6

func (p *ExecutablePlugin) Schema() string

func (*ExecutablePlugin) Usage

func (p *ExecutablePlugin) Usage() string

func (*ExecutablePlugin) Version

func (p *ExecutablePlugin) Version() string

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager descobre, carrega e gerencia o ciclo de vida dos plugins.

func NewManager

func NewManager(logger *zap.Logger) (*Manager, error)

func (*Manager) ClearRemotePlugins added in v1.60.0

func (m *Manager) ClearRemotePlugins()

ClearRemotePlugins removes all remote plugins (identified by Path() == "[remote]").

func (*Manager) Close

func (m *Manager) Close()

Close encerra o watcher de arquivos de forma segura.

func (*Manager) GetPlugin

func (m *Manager) GetPlugin(name string) (Plugin, bool)

func (*Manager) GetPlugins

func (m *Manager) GetPlugins() []Plugin

func (*Manager) PluginsDir

func (m *Manager) PluginsDir() string

PluginsDir retorna o diretório onde os plugins estão instalados.

func (*Manager) RegisterBuiltinPlugin added in v1.60.0

func (m *Manager) RegisterBuiltinPlugin(plugin Plugin)

RegisterBuiltinPlugin registers a builtin plugin. It is stored in a separate map so that Reload() can re-inject it when no external override exists.

func (*Manager) RegisterRemotePlugin added in v1.60.0

func (m *Manager) RegisterRemotePlugin(plugin Plugin)

RegisterRemotePlugin registers a remote plugin in the manager without saving to disk. This allows remote plugins to be discoverable via GetPlugin/GetPlugins.

func (*Manager) Reload

func (m *Manager) Reload()

Reload limpa e recarrega todos os plugins do diretório de plugins.

type Metadata

type Metadata struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Usage       string `json:"usage"`
	Version     string `json:"version"`
}

type Plugin

type Plugin interface {
	Name() string
	Description() string
	Usage() string
	Version() string
	Path() string
	Schema() string
	Execute(ctx context.Context, args []string) (string, error)
	ExecuteWithStream(ctx context.Context, args []string, onOutput func(string)) (string, error)
}

func NewPluginFromPath

func NewPluginFromPath(path string) (Plugin, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL