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

Function StringPtrFromEnvOrFile

pkg/lib/configreader/string_ptr.go:205–211  ·  view source on GitHub ↗
(envVarName string, filePath string, v *StringPtrValidation)

Source from the content-addressed store, hash-verified

203}
204
205func StringPtrFromEnvOrFile(envVarName string, filePath string, v *StringPtrValidation) (*string, error) {
206 valStr := ReadEnvVar(envVarName)
207 if valStr != nil {
208 return StringPtrFromEnv(envVarName, v)
209 }
210 return StringPtrFromFile(filePath, v)
211}
212
213func StringPtrFromPrompt(promptOpts *prompt.Options, v *StringPtrValidation) (*string, error) {
214 if v.Default != nil && promptOpts.DefaultStr == "" {

Callers

nothing calls this directly

Calls 3

ReadEnvVarFunction · 0.85
StringPtrFromEnvFunction · 0.85
StringPtrFromFileFunction · 0.85

Tested by

no test coverage detected