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

Function ParseYAMLBytes

pkg/lib/configreader/reader.go:1041–1053  ·  view source on GitHub ↗
(dest interface{}, validation *StructValidation, data []byte)

Source from the content-addressed store, hash-verified

1039}
1040
1041func ParseYAMLBytes(dest interface{}, validation *StructValidation, data []byte) error {
1042 fileInterface, err := ReadYAMLBytes(data)
1043 if err != nil {
1044 return err
1045 }
1046
1047 errs := Struct(dest, fileInterface, validation)
1048 if errors.HasError(errs) {
1049 return errors.FirstError(errs...)
1050 }
1051
1052 return nil
1053}
1054
1055func ReadYAMLFile(filePath string) (interface{}, error) {
1056 fileBytes, err := files.ReadFileBytes(filePath)

Callers

nothing calls this directly

Calls 4

HasErrorFunction · 0.92
FirstErrorFunction · 0.92
ReadYAMLBytesFunction · 0.85
StructFunction · 0.85

Tested by

no test coverage detected