MCPcopy Create free account
hub / github.com/AdRoll/baker / configKeysFromStruct

Function configKeysFromStruct

help_config.go:124–144  ·  view source on GitHub ↗
(cfg interface{})

Source from the content-addressed store, hash-verified

122}
123
124func configKeysFromStruct(cfg interface{}) ([]helpConfigKey, error) {
125 var keys []helpConfigKey
126
127 tf := reflect.TypeOf(cfg).Elem()
128 for i := 0; i < tf.NumField(); i++ {
129 f := tf.Field(i)
130
131 // skip unexported fields
132 if f.PkgPath != "" && !f.Anonymous {
133 continue
134 }
135
136 key, err := newHelpConfigKeyFromField(f)
137 if err != nil {
138 return nil, fmt.Errorf("error at exported key %d: %v", i, err)
139 }
140 keys = append(keys, key)
141 }
142
143 return keys, nil
144}
145
146func newHelpConfigKeyFromField(f reflect.StructField) (helpConfigKey, error) {
147 h := helpConfigKey{

Callers 5

newInputDocFunction · 0.85
newFilterDocFunction · 0.85
newOutputDocFunction · 0.85
newUploadDocFunction · 0.85
newMetricsDocFunction · 0.85

Calls 1

Tested by

no test coverage detected