Documentation
¶
Overview ¶
Package capture provides a bounded, concurrency-safe capture buffer for streamed output such as build or process logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capture ¶
type Capture struct {
// contains filtered or unexported fields
}
Capture stores written output up to a maximum byte size.
It implements io.Writer so it can be used with io.MultiWriter. Writers may run on multiple goroutines (e.g. a progress display alongside a message stream), so access is guarded. Writes never fail: once the limit is reached the remainder is dropped and the capture is marked truncated.
func New ¶
New returns a Capture that stores at most maxBytes of written output. A non-positive maxBytes captures nothing.