reader

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package reader defines a wrapper around io.Reader that supports graceful shutdowns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(in io.Reader, shutdown <-chan struct{}) io.Reader

NewReader creates a new Reader for use in Unilog. Once shutdown becomes readable, the returned Reader will start reading from the underlying Reader one byte at a time until newline, and then start returning EOF.

Types

type Reader

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

Reader wraps an existing io.Reader and adds the ability to perform a graceful shutdown by reading from the underlying Reader up through the next newline character, and then start returning EOF.

func (*Reader) Read

func (r *Reader) Read(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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