config.go 560 B

1234567891011121314151617181920212223242526
  1. package core
  2. // This structure is used to describe the plugin configuration item name and description.
  3. type Config struct {
  4. ConfigName string
  5. Description string
  6. }
  7. type NpsConfigs struct {
  8. configs []*Config
  9. }
  10. func NewNpsConfigs(name, des string) *NpsConfigs {
  11. c := &NpsConfigs{}
  12. c.configs = make([]*Config, 0)
  13. c.Add(name, des)
  14. return c
  15. }
  16. func (config *NpsConfigs) Add(name, des string) {
  17. config.configs = append(config.configs, &Config{ConfigName: name, Description: des})
  18. }
  19. func (config *NpsConfigs) GetAll() []*Config {
  20. return config.configs
  21. }