refactor conf

This commit is contained in:
Yuzuki616
2023-08-20 15:13:52 +08:00
parent 42407d5c62
commit 214324496d
19 changed files with 346 additions and 287 deletions

View File

@@ -39,12 +39,12 @@ func isSupported(protocol string, protocols []string) bool {
return false
}
func (s *Selector) AddNode(tag string, info *panel.NodeInfo, config *conf.Options) error {
func (s *Selector) AddNode(tag string, info *panel.NodeInfo, option *conf.Options) error {
for i := range s.cores {
if !isSupported(info.Type, s.cores[i].Protocols()) {
if option.Core != s.cores[i].Type() {
continue
}
err := s.cores[i].AddNode(tag, info, config)
err := s.cores[i].AddNode(tag, info, option)
if err != nil {
return err
}
@@ -97,3 +97,7 @@ func (s *Selector) Protocols() []string {
}
return protocols
}
func (s *Selector) Type() string {
return "selector"
}