boundedbuffer

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package boundedbuffer provides an io.Writer that retains at most a fixed number of bytes while reporting the original write lengths to its producer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

Buffer captures bounded command diagnostics without applying backpressure.

func New

func New(retention *boundedbufferv1.Retention) (*Buffer, error)

New constructs a Buffer from a validated retention policy.

func (*Buffer) Bytes

func (b *Buffer) Bytes() []byte

Bytes returns the retained prefix. The returned slice aliases the Buffer.

func (*Buffer) String

func (b *Buffer) String() string

String returns the retained prefix and marks it when bytes were discarded.

func (*Buffer) Truncated

func (b *Buffer) Truncated() bool

Truncated reports whether bytes were discarded after the retention bound.

func (*Buffer) Write

func (b *Buffer) Write(data []byte) (int, error)

Write retains the prefix that fits and reports the full input length so callers such as os/exec can continue draining process output.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL