io

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProbedWriter

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

ProbedWriter wraps an io.Writer and maintains the last N bytes written to it.

func NewProbedWriter

func NewProbedWriter(w io.Writer, n int) *ProbedWriter

NewProbedWriter creates a new ProbedWriter with a probe buffer for the last n bytes.

func NewUnlimitedProbedWriter added in v0.0.16

func NewUnlimitedProbedWriter(w io.Writer) *ProbedWriter

NewUnlimitedProbedWriter creates a new ProbedWriter with a probe buffer of unlimited size.

func (*ProbedWriter) Bytes

func (l *ProbedWriter) Bytes() []byte

Bytes returns the last N bytes written.

func (*ProbedWriter) Len added in v0.0.16

func (l *ProbedWriter) Len() int

func (*ProbedWriter) Reset

func (l *ProbedWriter) Reset()

func (*ProbedWriter) String

func (l *ProbedWriter) String() string

String returns the last N bytes written as a string.

func (*ProbedWriter) Write

func (l *ProbedWriter) Write(p []byte) (n int, err error)

Write writes p to the underlying io.Writer and keeps the last N bytes in a buffer.

Jump to

Keyboard shortcuts

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