MCPcopy Create free account
hub / github.com/Monibuca/engine / assign

Method assign

plugin.go:110–125  ·  view source on GitHub ↗

读取独立配置合并入总配置中

()

Source from the content-addressed store, hash-verified

108
109// 读取独立配置合并入总配置中
110func (opt *Plugin) assign() {
111 f, err := os.Open(opt.settingPath())
112 defer f.Close()
113 if err == nil {
114 var modifyConfig map[string]any
115 err = yaml.NewDecoder(f).Decode(&modifyConfig)
116 if err != nil {
117 panic(err)
118 }
119 opt.RawConfig.ParseModifyFile(modifyConfig)
120 }
121 opt.registerHandler()
122 if opt != Engine {
123 opt.run()
124 }
125}
126
127func (opt *Plugin) run() {
128 opt.Context, opt.CancelFunc = context.WithCancel(Engine)

Callers 1

RunFunction · 0.45

Calls 5

settingPathMethod · 0.95
registerHandlerMethod · 0.95
runMethod · 0.95
ParseModifyFileMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected