discovery

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositeDiscoverer

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

CompositeDiscoverer 复合插件发现器 组合多个插件发现器

func NewCompositeDiscoverer

func NewCompositeDiscoverer(discoverers ...PluginDiscoverer) *CompositeDiscoverer

NewCompositeDiscoverer 创建一个新的复合插件发现器

func (*CompositeDiscoverer) Close

func (d *CompositeDiscoverer) Close() error

Close 关闭发现器

func (*CompositeDiscoverer) DiscoverPlugins

func (d *CompositeDiscoverer) DiscoverPlugins(ctx context.Context) ([]api.PluginMetadata, error)

DiscoverPlugins 发现插件

func (*CompositeDiscoverer) WatchPlugins

func (d *CompositeDiscoverer) WatchPlugins(ctx context.Context) (<-chan api.PluginEvent, error)

WatchPlugins 监听插件变化

type FileSystemDiscoverer

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

FileSystemDiscoverer 文件系统插件发现器 从文件系统中发现插件

func NewFileSystemDiscoverer

func NewFileSystemDiscoverer(directories []string, options ...FileSystemDiscovererOption) *FileSystemDiscoverer

NewFileSystemDiscoverer 创建一个新的文件系统插件发现器

func (*FileSystemDiscoverer) Close

func (d *FileSystemDiscoverer) Close() error

Close 关闭发现器

func (*FileSystemDiscoverer) DiscoverPlugins

func (d *FileSystemDiscoverer) DiscoverPlugins(ctx context.Context) ([]api.PluginMetadata, error)

DiscoverPlugins 发现插件

func (*FileSystemDiscoverer) WatchPlugins

func (d *FileSystemDiscoverer) WatchPlugins(ctx context.Context) (<-chan api.PluginEvent, error)

WatchPlugins 监听插件变化

type FileSystemDiscovererOption

type FileSystemDiscovererOption func(*FileSystemDiscoverer)

FileSystemDiscovererOption 文件系统插件发现器选项

func WithLogger

func WithLogger(logger hclog.Logger) FileSystemDiscovererOption

WithLogger 设置日志记录器

func WithPatterns

func WithPatterns(patterns []string) FileSystemDiscovererOption

WithPatterns 设置文件模式

func WithRecursive

func WithRecursive(recursive bool) FileSystemDiscovererOption

WithRecursive 设置是否递归扫描

type PluginDiscoverer

type PluginDiscoverer interface {
	// DiscoverPlugins 发现插件
	// ctx: 上下文
	// 返回: 插件元数据列表和错误
	DiscoverPlugins(ctx context.Context) ([]api.PluginMetadata, error)

	// WatchPlugins 监听插件变化
	// ctx: 上下文
	// 返回: 插件事件通道和错误
	WatchPlugins(ctx context.Context) (<-chan api.PluginEvent, error)

	// Close 关闭发现器
	// 返回: 错误
	Close() error
}

PluginDiscoverer 插件发现器接口 负责发现可用的插件

Jump to

Keyboard shortcuts

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