MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / TmpFileResponseWriter

Struct TmpFileResponseWriter

cache/tmp_file_response_writer.go:15–26  ·  view source on GitHub ↗

TmpFileResponseWriter caches Clickhouse response. the http header are kept in memory

Source from the content-addressed store, hash-verified

13// TmpFileResponseWriter caches Clickhouse response.
14// the http header are kept in memory
15type TmpFileResponseWriter struct {
16 http.ResponseWriter // the original response writer
17
18 contentLength int64
19 contentType string
20 contentEncoding string
21 headersCaptured bool
22 statusCode int
23
24 tmpFile *os.File // temporary file for response streaming
25 bw *bufio.Writer // buffered writer for the temporary file
26}
27
28func NewTmpFileResponseWriter(rw http.ResponseWriter, dir string) (*TmpFileResponseWriter, error) {
29 _, ok := rw.(http.CloseNotifier)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected