MCPcopy
hub / github.com/cortexlabs/cortex / ParseYAMLFile

Function ParseYAMLFile

pkg/lib/configreader/reader.go:1027–1039  ·  view source on GitHub ↗

JSON and YAML Config

(dest interface{}, validation *StructValidation, filePath string)

Source from the content-addressed store, hash-verified

1025//
1026
1027func ParseYAMLFile(dest interface{}, validation *StructValidation, filePath string) []error {
1028 fileInterface, err := ReadYAMLFile(filePath)
1029 if err != nil {
1030 return []error{err}
1031 }
1032
1033 errs := Struct(dest, fileInterface, validation)
1034 if errors.HasError(errs) {
1035 return errors.WrapAll(errs, filePath)
1036 }
1037
1038 return nil
1039}
1040
1041func ParseYAMLBytes(dest interface{}, validation *StructValidation, data []byte) error {
1042 fileInterface, err := ReadYAMLBytes(data)

Callers

nothing calls this directly

Calls 4

HasErrorFunction · 0.92
WrapAllFunction · 0.92
ReadYAMLFileFunction · 0.85
StructFunction · 0.85

Tested by

no test coverage detected