mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 14:46:36 +08:00
c77b5358e2
配置读取框架的内核侧抽象:插件用带 config/env/default/autoEnable/secret tag 的结构体声明自己读哪些字段,注册表按 key 归集并对重复声明做一致性 校验,为后续按声明解析与门禁求值提供基础。
26 lines
574 B
Go
26 lines
574 B
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package extpoints
|
|
|
|
import "sort"
|
|
|
|
// Entries returns the effective configuration as redacted, key-sorted entries.
|
|
func (r *ConfigRegistry) Entries() []ConfigEntry {
|
|
r.mu.RLock()
|
|
defer r.mu.RUnlock()
|
|
|
|
keys := append([]string(nil), r.order...)
|
|
sort.Strings(keys)
|
|
|
|
out := make([]ConfigEntry, 0, len(keys))
|
|
for _, key := range keys {
|
|
d := r.decls[key]
|
|
out = append(out, ConfigEntry{
|
|
Key: d.key, PluginID: d.pluginID, Env: d.env,
|
|
Origin: r.origins[key], Value: "pending",
|
|
})
|
|
}
|
|
return out
|
|
}
|