MCPcopy
hub / github.com/minio/minio-go / NewSelectResults

Function NewSelectResults

api-select.go:479–493  ·  view source on GitHub ↗

NewSelectResults creates a Select Result parser that parses the response and returns a Reader that will return parsed and assembled select output.

(resp *http.Response, bucketName string)

Source from the content-addressed store, hash-verified

477// NewSelectResults creates a Select Result parser that parses the response
478// and returns a Reader that will return parsed and assembled select output.
479func NewSelectResults(resp *http.Response, bucketName string) (*SelectResults, error) {
480 if resp.StatusCode != http.StatusOK {
481 return nil, httpRespToErrorResponse(resp, bucketName, "")
482 }
483
484 pipeReader, pipeWriter := io.Pipe()
485 streamer := &SelectResults{
486 resp: resp,
487 stats: &StatsMessage{},
488 progress: &ProgressMessage{},
489 pipeReader: pipeReader,
490 }
491 streamer.start(pipeWriter)
492 return streamer, nil
493}
494
495// Close - closes the underlying response body and the stream reader.
496func (s *SelectResults) Close() error {

Callers 1

SelectObjectContentMethod · 0.85

Calls 2

startMethod · 0.95
httpRespToErrorResponseFunction · 0.85

Tested by

no test coverage detected