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

Function Int64PtrFromStr

pkg/lib/configreader/int64_ptr.go:97–106  ·  view source on GitHub ↗
(valStr string, v *Int64PtrValidation)

Source from the content-addressed store, hash-verified

95}
96
97func Int64PtrFromStr(valStr string, v *Int64PtrValidation) (*int64, error) {
98 if valStr == "" {
99 return ValidateInt64PtrMissing(v)
100 }
101 casted, castOk := s.ParseInt64(valStr)
102 if !castOk {
103 return nil, ErrorInvalidPrimitiveType(valStr, PrimTypeInt)
104 }
105 return ValidateInt64PtrProvided(&casted, v)
106}
107
108func Int64PtrFromEnv(envVarName string, v *Int64PtrValidation) (*int64, error) {
109 valStr := ReadEnvVar(envVarName)

Callers 5

StructFromStringMapFunction · 0.85
Int64PtrFromStrMapFunction · 0.85
Int64PtrFromEnvFunction · 0.85
Int64PtrFromFileFunction · 0.85
Int64PtrFromPromptFunction · 0.85

Calls 3

ValidateInt64PtrMissingFunction · 0.85
ValidateInt64PtrProvidedFunction · 0.85

Tested by

no test coverage detected