A BufferCache is like a map[string][]byte that is optimized for appending new bytes to the cache values.
| 52 | // A BufferCache is like a map[string][]byte that is optimized for appending |
| 53 | // new bytes to the cache values. |
| 54 | type BufferCache struct { |
| 55 | m locationMap |
| 56 | cold *coldCache |
| 57 | hot struct { |
| 58 | m map[string][]byte // actual cache |
| 59 | cap, maxcap int // current and total capacity (sum of all buffers) |
| 60 | maxbuflen int // max length allowed for a single buffer |
| 61 | } |
| 62 | |
| 63 | // onFlush is called each time a buffer is evicted from the cache. |
| 64 | // nflushes is the number of times onFlush is called. |
| 65 | onFlush func([]byte) |
| 66 | nflushes uint64 |
| 67 | |
| 68 | compressionOn bool |
| 69 | comp compressor |
| 70 | decomp decompressor |
| 71 | } |
| 72 | |
| 73 | type errInvalidConfig string |
| 74 |
nothing calls this directly
no outgoing calls
no test coverage detected