MCPcopy Index your code
hub / github.com/coder/coder / Bytes

Method Bytes

agent/agentproc/headtail.go:164–178  ·  view source on GitHub ↗

Bytes returns a copy of the raw buffer contents. If no truncation has occurred the full output is returned; otherwise the head and tail portions are concatenated.

()

Source from the content-addressed store, hash-verified

162// truncation has occurred the full output is returned;
163// otherwise the head and tail portions are concatenated.
164func (b *HeadTailBuffer) Bytes() []byte {
165 b.mu.Lock()
166 defer b.mu.Unlock()
167
168 tail := b.tailBytes()
169 if len(tail) == 0 {
170 out := make([]byte, len(b.head))
171 copy(out, b.head)
172 return out
173 }
174 out := make([]byte, len(b.head)+len(tail))
175 copy(out, b.head)
176 copy(out[len(b.head):], tail)
177 return out
178}
179
180// Len returns the number of bytes currently stored in the
181// buffer.

Callers 15

readDeltaMethod · 0.45
encodeForStreamMethod · 0.45
DumpRequestMethod · 0.45
DumpResponseMethod · 0.45
encodeForStreamMethod · 0.45
CreateTarFromZipFunction · 0.45
CreateZipFromTarFunction · 0.45
buildTestZipFunction · 0.45
runFakeMCPServerFunction · 0.45
TestRecordingStartStopFunction · 0.45

Calls 3

tailBytesMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45