MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / Read

Method Read

rest/counted_request_reader.go:30–37  ·  view source on GitHub ↗

Read overrides the Read method from io package that will add the number of bytes read to the CountedRequestReader struct for retrieval for the stat on the database

(buf []byte)

Source from the content-addressed store, hash-verified

28// Read overrides the Read method from io package that will add the number of bytes read to the CountedRequestReader struct for
29// retrieval for the stat on the database
30func (c *CountedRequestReader) Read(buf []byte) (int, error) {
31 numBytesRead, err := c.reader.Read(buf)
32
33 if !c.bodyRead {
34 c.numBytes += int64(numBytesRead)
35 }
36 return numBytesRead, err
37}
38
39// GetBodyBytesCount will load the number of bytes read for the request from the CountedRequestReader struct. If count
40// is 0 its possible we haven't yet read the body so will do that in the event of 0 count.

Callers 3

FastRandBytesFunction · 0.80
randCryptoHexFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected