MCPcopy Create free account
hub / github.com/cortexlabs/cortex / Int64PtrFromInterfaceMap

Function Int64PtrFromInterfaceMap

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

Source from the content-addressed store, hash-verified

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

Callers 1

StructFunction · 0.85

Calls 4

WrapFunction · 0.92
ReadInterfaceMapValueFunction · 0.85
ValidateInt64PtrMissingFunction · 0.85
Int64PtrFunction · 0.85

Tested by

no test coverage detected