Xray-core/infra/conf/lint.go
yuhan6665 f50eff5ebb
Add Fake DNS support (#309)
Co-authored-by: Xiaokang Wang <xiaokangwang@outlook.com>
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
Co-authored-by: kslr <kslrwang@gmail.com>
2021-03-07 04:39:50 +00:00

23 lines
719 B
Go

package conf
type ConfigureFilePostProcessingStage interface {
Process(conf *Config) error
}
var configureFilePostProcessingStages map[string]ConfigureFilePostProcessingStage
func RegisterConfigureFilePostProcessingStage(name string, stage ConfigureFilePostProcessingStage) {
if configureFilePostProcessingStages == nil {
configureFilePostProcessingStages = make(map[string]ConfigureFilePostProcessingStage)
}
configureFilePostProcessingStages[name] = stage
}
func PostProcessConfigureFile(conf *Config) error {
for k, v := range configureFilePostProcessingStages {
if err := v.Process(conf); err != nil {
return newError("Rejected by Postprocessing Stage ", k).AtError().Base(err)
}
}
return nil
}