sized

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

Writer wraps an io.WriteCloser and adds a size limit. when the size limit is reached, the io.WriteCloser is closed and a new one is created using the open function.

func NewWriter

func NewWriter(
	ctx context.Context,
	n int,
	saveCommandChan chan int,
	limit uint64,
	open func(context.Context, int, *atomic.Uint64) (io.WriteCloser, error),
) (*Writer, error)

NewWriter creates a new Writer with a size limit. limit must be greater than 0.

func (*Writer) Close

func (f *Writer) Close() error

func (*Writer) Write

func (f *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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