|
@@ -1,27 +1,34 @@
|
|
|
+
|
|
|
package core
|
|
|
|
|
|
-
|
|
|
+import "regexp"
|
|
|
+
|
|
|
+
|
|
|
type Config struct {
|
|
|
- ConfigName string
|
|
|
- Description string
|
|
|
- ConfigLevel ConfigLevel
|
|
|
+ ConfigName string
|
|
|
+ ZhTitle string
|
|
|
+ EnTitle string
|
|
|
+ ZhDescription string
|
|
|
+ EnDescription string
|
|
|
+ LimitReg *regexp.Regexp
|
|
|
+ ConfigLevel ConfigLevel
|
|
|
}
|
|
|
|
|
|
+
|
|
|
type NpsConfigs struct {
|
|
|
- configs []*Config
|
|
|
-}
|
|
|
-
|
|
|
-func NewNpsConfigs(name, des string, level ConfigLevel) *NpsConfigs {
|
|
|
- c := &NpsConfigs{}
|
|
|
- c.configs = make([]*Config, 0)
|
|
|
- c.Add(name, des, level)
|
|
|
- return c
|
|
|
+ ZhTitle string
|
|
|
+ EnTitle string
|
|
|
+ EnDescription string
|
|
|
+ ZhDescription string
|
|
|
+ configs []*Config
|
|
|
}
|
|
|
|
|
|
-func (config *NpsConfigs) Add(name, des string, level ConfigLevel) {
|
|
|
- config.configs = append(config.configs, &Config{ConfigName: name, Description: des, ConfigLevel: level})
|
|
|
+
|
|
|
+func (config *NpsConfigs) Add(cfg *Config) {
|
|
|
+ config.configs = append(config.configs, cfg)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
func (config *NpsConfigs) GetAll() []*Config {
|
|
|
return config.configs
|
|
|
}
|