streamio

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0, GPL-2.0, GPL-3.0-or-later, + 1 more Imports: 7 Imported by: 0

Documentation

Overview

Package streamio implements utilities for working with streaming I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuneScanner

type RuneScanner interface {
	io.RuneScanner
	io.Closer
}

func NewRuneScanner

func NewRuneScanner(ctx context.Context, fh *os.File) (RuneScanner, error)

NewRuneScanner returns an io.RuneScanner (and io.Closer) that bufferes a file, similar to bufio.NewReader. There are two advantages over bufio.NewReader:

  • It takes a Context, and causes reads to fail once the Context is canceled; allowing large parse operations to be gracefully cut short.

  • It logs the progress of reading the file via textui.Progress.

Jump to

Keyboard shortcuts

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