MCPcopy Create free account
hub / github.com/compozy/agh / configNodeFromValue

Function configNodeFromValue

internal/cli/config.go:937–955  ·  view source on GitHub ↗
(value reflect.Value, fieldName string)

Source from the content-addressed store, hash-verified

935}
936
937func configNodeFromValue(value reflect.Value, fieldName string) (any, bool) {
938 value, ok := indirectConfigValue(value)
939 if !ok {
940 return nil, false
941 }
942 if value.Type() == configDurationType {
943 return time.Duration(value.Int()).String(), true
944 }
945 switch value.Kind() {
946 case reflect.Struct:
947 return configStructNode(value)
948 case reflect.Map:
949 return configMapNode(value, fieldName)
950 case reflect.Slice, reflect.Array:
951 return configSequenceNode(value, fieldName)
952 default:
953 return configScalarNode(value)
954 }
955}
956
957func indirectConfigValue(value reflect.Value) (reflect.Value, bool) {
958 if !value.IsValid() {

Callers 4

redactedConfigMapFunction · 0.70
configStructNodeFunction · 0.70
configMapNodeFunction · 0.70
configSequenceNodeFunction · 0.70

Calls 7

indirectConfigValueFunction · 0.70
configStructNodeFunction · 0.70
configMapNodeFunction · 0.70
configSequenceNodeFunction · 0.70
configScalarNodeFunction · 0.70
KindMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected