Documentation
¶
Overview ¶
Package outputguard serializes protocol and print output through one stateful writer boundary.
Index ¶
- Constants
- type Options
- type Writer
- func (w *Writer) Err() error
- func (w *Writer) Flush() error
- func (w *Writer) FlushContext(ctx context.Context) error
- func (w *Writer) Write(data []byte) (int, error)
- func (w *Writer) WriteContext(ctx context.Context, data []byte) (int, error)
- func (w *Writer) WriteString(text string) (int, error)
- func (w *Writer) WriteStringContext(ctx context.Context, text string) (int, error)
Constants ¶
const DefaultRetryDelay = 10 * time.Millisecond
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer owns an output destination, serializes complete logical writes, and retains the first permanent output error. Synchronous io.Writer calls provide the backpressure boundary; Flush is a barrier for all preceding writes.
func (*Writer) Flush ¶
Flush waits for preceding writes, flushes buffered destinations when supported, and returns the first permanent output error.
func (*Writer) FlushContext ¶
FlushContext is Flush with cancellation support while retrying a transient flusher error.
func (*Writer) Write ¶
Write implements io.Writer. It does not return until the whole logical chunk has been accepted or a permanent error occurs.
func (*Writer) WriteContext ¶
WriteContext is Write with cancellation support while retrying transient output pressure.
func (*Writer) WriteString ¶
WriteString writes one logical text chunk without allowing concurrent chunks to interleave.