MCPcopy Index your code
hub / github.com/cortexlabs/cortex / InterfaceMapFromInterfaceMap

Function InterfaceMapFromInterfaceMap

pkg/lib/configreader/interface_map.go:49–63  ·  view source on GitHub ↗
(key string, iMap map[string]interface{}, v *InterfaceMapValidation)

Source from the content-addressed store, hash-verified

47}
48
49func InterfaceMapFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceMapValidation) (map[string]interface{}, error) {
50 inter, ok := ReadInterfaceMapValue(key, iMap)
51 if !ok {
52 val, err := ValidateInterfaceMapMissing(v)
53 if err != nil {
54 return nil, errors.Wrap(err, key)
55 }
56 return val, nil
57 }
58 val, err := InterfaceMap(inter, v)
59 if err != nil {
60 return nil, errors.Wrap(err, key)
61 }
62 return val, nil
63}
64
65func ValidateInterfaceMapMissing(v *InterfaceMapValidation) (map[string]interface{}, error) {
66 if v.Required {

Callers 1

StructFunction · 0.85

Calls 4

WrapFunction · 0.92
ReadInterfaceMapValueFunction · 0.85
InterfaceMapFunction · 0.85

Tested by

no test coverage detected