plugins

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) 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) 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