config_meta.go 416 B

123456789101112131415161718192021
  1. package config
  2. var (
  3. _metaConfig *MetaConfig
  4. )
  5. type MetaConfig struct {
  6. ServerDebug bool `yaml:"server-debug,omitempty"`
  7. StaticDir string `yaml:"static-dir,omitempty"`
  8. PassPortCheckUrl string `yaml:"pass-port-check-url,omitempty"`
  9. }
  10. func InitMeta(path string) {
  11. var config MetaConfig
  12. readConfig(path, &config)
  13. _metaConfig = &config
  14. }
  15. func GetMetaConfig() MetaConfig {
  16. return *_metaConfig
  17. }