plugins

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

internal/plugins/plugins.go 插件系统:发现和加载 plugin.json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description"`
	Path        string `json:"-"` // 插件目录路径
	Source      string `json:"-"` // 来源:user / project
	Loaded      bool   `json:"-"` // 是否成功加载
	Error       string `json:"-"` // 加载错误信息
}

Plugin 插件定义

type Registry

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

Registry 插件注册表

func NewRegistry

func NewRegistry() *Registry

NewRegistry 创建插件注册表

func (*Registry) All

func (r *Registry) All() []*Plugin

All 返回所有插件

func (*Registry) Discover

func (r *Registry) Discover(configDir string)

Discover 发现并加载插件 扫描 ~/.xincode/plugins/ 和 .xincode/plugins/ 目录

func (*Registry) Get

func (r *Registry) Get(name string) (*Plugin, bool)

Get 获取插件

func (*Registry) ListString

func (r *Registry) ListString() string

ListString 返回插件列表的格式化字符串

Jump to

Keyboard shortcuts

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