this function should only be called by the wconfig code. in golang code, the best way to get the current config is via the watcher -- wconfig.GetWatcher().GetFullConfig()
()
| 672 | // this function should only be called by the wconfig code. |
| 673 | // in golang code, the best way to get the current config is via the watcher -- wconfig.GetWatcher().GetFullConfig() |
| 674 | func ReadFullConfig() FullConfigType { |
| 675 | var fullConfig FullConfigType |
| 676 | configRType := reflect.TypeOf(fullConfig) |
| 677 | configRVal := reflect.ValueOf(&fullConfig).Elem() |
| 678 | for fieldIdx := 0; fieldIdx < configRType.NumField(); fieldIdx++ { |
| 679 | field := configRType.Field(fieldIdx) |
| 680 | if field.PkgPath != "" { |
| 681 | continue |
| 682 | } |
| 683 | configFile := field.Tag.Get("configfile") |
| 684 | if configFile == "-" { |
| 685 | continue |
| 686 | } |
| 687 | jsonTag := utilfn.GetJsonTag(field) |
| 688 | simpleMerge := field.Tag.Get("merge") == "" |
| 689 | var configPart waveobj.MetaMapType |
| 690 | var errs []ConfigError |
| 691 | if jsonTag == "-" || jsonTag == "" { |
| 692 | continue |
| 693 | } else { |
| 694 | configPart, errs = readConfigPart(jsonTag, simpleMerge) |
| 695 | } |
| 696 | fullConfig.ConfigErrors = append(fullConfig.ConfigErrors, errs...) |
| 697 | if configPart != nil { |
| 698 | fieldPtr := configRVal.Field(fieldIdx).Addr().Interface() |
| 699 | utilfn.ReUnmarshal(fieldPtr, configPart) |
| 700 | } |
| 701 | } |
| 702 | fullConfig.Version = wavebase.WaveVersion |
| 703 | fullConfig.BuildTime = wavebase.BuildTime |
| 704 | return fullConfig |
| 705 | } |
| 706 | |
| 707 | func GetConfigSubdirs() []string { |
| 708 | var fullConfig FullConfigType |
no test coverage detected