MCPcopy
hub / github.com/grafana/tempo / NewSuccessfulResponse

Function NewSuccessfulResponse

modules/frontend/pipeline/responses.go:78–84  ·  view source on GitHub ↗

NewSuccessfulResponse creates a new AsyncResponse that wraps a single http.Response with a 200 status code and the provided body.

(body string)

Source from the content-addressed store, hash-verified

76
77// NewSuccessfulResponse creates a new AsyncResponse that wraps a single http.Response with a 200 status code and the provided body.
78func NewSuccessfulResponse(body string) Responses[combiner.PipelineResponse] {
79 return NewHTTPToAsyncResponse(&http.Response{
80 StatusCode: http.StatusOK,
81 Status: http.StatusText(http.StatusOK),
82 Body: io.NopCloser(strings.NewReader(body)),
83 })
84}
85
86func (s syncResponse) Next(ctx context.Context) (combiner.PipelineResponse, bool, error) {
87 if err := ctx.Err(); err != nil {

Calls 1

NewHTTPToAsyncResponseFunction · 0.85

Tested by 3