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

Function IntPtrFromInterfaceMap

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

Source from the content-addressed store, hash-verified

63}
64
65func IntPtrFromInterfaceMap(key string, iMap map[string]interface{}, v *IntPtrValidation) (*int, error) {
66 inter, ok := ReadInterfaceMapValue(key, iMap)
67 if !ok {
68 val, err := ValidateIntPtrMissing(v)
69 if err != nil {
70 return nil, errors.Wrap(err, key)
71 }
72 return val, nil
73 }
74 val, err := IntPtr(inter, v)
75 if err != nil {
76 return nil, errors.Wrap(err, key)
77 }
78 return val, nil
79}
80
81func IntPtrFromStrMap(key string, sMap map[string]string, v *IntPtrValidation) (*int, error) {
82 valStr, ok := sMap[key]

Callers 1

StructFunction · 0.85

Calls 4

WrapFunction · 0.92
ReadInterfaceMapValueFunction · 0.85
ValidateIntPtrMissingFunction · 0.85
IntPtrFunction · 0.85

Tested by

no test coverage detected