config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config 识别 plugins 配置树,得到 PluginUse。

不查注册表、不调用构造函数、不解释业务字段。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name string
	List bool
	Uses []PluginUse
}

Field 是 plugins 下一个配置键的规范化结果。

func Parse

func Parse(plugins map[string]any) ([]Field, error)

Parse 把 plugins 配置树识别为字段列表。

value 可以是单个对象或数组。map 的 key 顺序不稳定,返回的字段按 Name 排序。 缺省 id:单值字段使用字段名;多值字段使用 `{字段名}[{下标}]`。

type PluginUse

type PluginUse struct {
	ID     string
	Use    string
	Config map[string]any
	Deps   map[string]any
}

PluginUse 描述如何选用一个已注册的插件类型。

Jump to

Keyboard shortcuts

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