Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TruncBuffer ¶
type TruncBuffer struct {
// contains filtered or unexported fields
}
TruncBuffer is a ring buffer that retains only the last max bytes, discarding older data. This is useful for capturing stderr output in a memory-bounded way when the full output may be arbitrarily large. All methods are safe for concurrent use.
func NewTruncBuffer ¶
func NewTruncBuffer(n int) *TruncBuffer
NewTruncBuffer creates a TruncBuffer that keeps at most n bytes.
func (*TruncBuffer) Bytes ¶
func (t *TruncBuffer) Bytes() []byte
Bytes returns a copy of the current buffer contents in order.
func (*TruncBuffer) String ¶
func (t *TruncBuffer) String() string
String returns the buffer contents as a string.
Click to show internal directories.
Click to hide internal directories.