MCPcopy
hub / github.com/keploy/keploy / ReadNextDocument

Method ReadNextDocument

pkg/platform/yaml/mockreader.go:83–92  ·  view source on GitHub ↗

ReadNextDocument reads lines until it encounters "---" or EOF (YAML), or reads one line for NDJSON (JSON format).

()

Source from the content-addressed store, hash-verified

81// ReadNextDocument reads lines until it encounters "---" or EOF (YAML),
82// or reads one line for NDJSON (JSON format).
83func (r *MockReader) ReadNextDocument() ([]byte, error) {
84 if r.done {
85 return nil, io.EOF
86 }
87
88 if r.format == FormatJSON {
89 return r.readNextJSONLine()
90 }
91 return r.readNextYAMLDocument()
92}
93
94func (r *MockReader) readNextJSONLine() ([]byte, error) {
95 for {

Callers 2

ReadNextDocMethod · 0.95
ReadNextDocJSONMethod · 0.95

Calls 2

readNextJSONLineMethod · 0.95
readNextYAMLDocumentMethod · 0.95

Tested by

no test coverage detected