Help us shape the future of Go! Take the 2026 Go Developer Survey

fallback

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirBuffer

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

func NewDirBuffer

func NewDirBuffer(dir string) *DirBuffer

A disk-based ping-pong buffer. Reads and writes can be done simultaneously.

func (*DirBuffer) Close

func (f *DirBuffer) Close() (err error)

Close implements io.WriteCloser.

func (*DirBuffer) HasData added in v0.8.0

func (d *DirBuffer) HasData() (ok bool, err error)

func (*DirBuffer) Reader

func (d *DirBuffer) Reader(fn func(n int, r io.Reader) error) (err error)

func (*DirBuffer) Write

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

Write implements io.WriteCloser.

type Fallback added in v0.8.0

type Fallback interface {
	io.WriteCloser
	HasData() (ok bool, err error)
	Reader(fn func(n int, r io.Reader) error) (err error)
}

type FileBuffer

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

A file-based buffer. Reads and writes are blocking each other - always prefer using the DirBuffer for this reason.

func NewFileBuffer

func NewFileBuffer(path string) *FileBuffer

func (*FileBuffer) Close

func (f *FileBuffer) Close() (err error)

Close implements io.WriteCloser.

func (*FileBuffer) HasData added in v0.8.0

func (f *FileBuffer) HasData() (ok bool, err error)

HasData implements Fallback.

func (*FileBuffer) Reader added in v0.8.0

func (f *FileBuffer) Reader(fn func(n int, r io.Reader) error) (err error)

Reader implements Fallback.

func (*FileBuffer) Write

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

Write implements io.WriteCloser.

Jump to

Keyboard shortcuts

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