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

Function InterfaceFromInterfaceMap

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

Source from the content-addressed store, hash-verified

41}
42
43func InterfaceFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceValidation) (interface{}, error) {
44 inter, ok := ReadInterfaceMapValue(key, iMap)
45 if !ok {
46 val, err := ValidateInterfaceMissing(v)
47 if err != nil {
48 return nil, errors.Wrap(err, key)
49 }
50 return val, nil
51 }
52 val, err := ValidateInterfaceProvided(inter, v)
53 if err != nil {
54 return nil, errors.Wrap(err, key)
55 }
56 return val, nil
57}
58
59func ValidateInterfaceMissing(v *InterfaceValidation) (interface{}, error) {
60 if v.Required {

Callers 1

StructFunction · 0.85

Calls 4

WrapFunction · 0.92
ReadInterfaceMapValueFunction · 0.85
ValidateInterfaceMissingFunction · 0.85

Tested by

no test coverage detected