MCPcopy
hub / github.com/wavetermdev/waveterm / ReadFullConfig

Function ReadFullConfig

pkg/wconfig/settingsconfig.go:674–705  ·  view source on GitHub ↗

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()

()

Source from the content-addressed store, hash-verified

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()
674func 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
707func GetConfigSubdirs() []string {
708 var fullConfig FullConfigType

Callers 2

sendInitialValuesMethod · 0.85

Calls 4

GetJsonTagFunction · 0.92
ReUnmarshalFunction · 0.92
readConfigPartFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected