Chore: improve code architecture
This commit is contained in:
21
hub/hub.go
Normal file
21
hub/hub.go
Normal file
@ -0,0 +1,21 @@
|
||||
package hub
|
||||
|
||||
import (
|
||||
"github.com/Dreamacro/clash/hub/executor"
|
||||
"github.com/Dreamacro/clash/hub/route"
|
||||
)
|
||||
|
||||
// Parse call at the beginning of clash
|
||||
func Parse() error {
|
||||
cfg, err := executor.Parse()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if cfg.General.ExternalController != "" {
|
||||
go route.Start(cfg.General.ExternalController, cfg.General.Secret)
|
||||
}
|
||||
|
||||
executor.ApplyConfig(cfg)
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user