device

package
v0.0.0-...-d0f7b5f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package stdio wraps stdin, stdout, and file operations with the semantics required elsewhere in this system and that work around any consequences of the sys.env table being user-writable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	File() (f *os.File, reset func(), err error)
}

File is a device backed by an os.File that allows access directly to the file handle.

When done with the os.File, users of this interface must ensure the file is in a good state for future reading and writing and then call the returned reset function that ensures the device can function as a device.

type Reader

type Reader interface {
	io.ReadCloser
	//Unwrap returns the underlying bufio.Reader for external packages
	//that need direct access.
	Unwrap() *bufio.Reader
	//Name returns the name of the file being read or - for stdin.
	Name() string
}

Reader is the interface provided by all readers in this package.

type Writer

type Writer interface {
	io.WriteCloser
	Flush() error
	WriteString(string) (int, error)
	//Unwrap returns the underlying bufio.Writer for external packages
	//that need direct access.
	Unwrap() *bufio.Writer
	//Name returns the target name of the file or - for stdout.
	Name() string
	//Cancel tells the Writer to continue operating as normally but
	//the Writer can choose not to create a final output.
	Cancel()
}

Writer is the interface provided by all writers in this package.

Directories

Path Synopsis
Package file implements file devices.
Package file implements file devices.
Package std supplies devices for std.In and std.Out.
Package std supplies devices for std.In and std.Out.

Jump to

Keyboard shortcuts

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