rwi

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: CC0-1.0 Imports: 4 Imported by: 31

Documentation

Overview

Package rwi : Reader/Writer Interface for command-line

These codes are licensed under CC0. http://creativecommons.org/publicdomain/zero/1.0/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptFunc

type OptFunc func(*RWI)

OptFunc is self-referential function for functional options pattern

func ErrorWriter

func ErrorWriter(e io.Writer) OptFunc

ErrorWriter returns closure as type OptFunc

func Reader

func Reader(r io.Reader) OptFunc

Reader returns closure as type OptFunc

func Writer

func Writer(w io.Writer) OptFunc

Writer returns closure as type OptFunc

type RWI

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

RWI is Reader/Writer class for command-line

func New

func New(opts ...OptFunc) *RWI

New returns a new RWI instance

func (*RWI) ErrorWriter

func (c *RWI) ErrorWriter() io.Writer

ErrorWriter returns RWI.errorWriter

func (*RWI) Output

func (c *RWI) Output(val ...interface{}) error

Output output to RWI.writer

func (*RWI) OutputBytes

func (c *RWI) OutputBytes(data []byte) error

OutputBytes to RWI.writer ([]byte data).

func (*RWI) OutputErr

func (c *RWI) OutputErr(val ...interface{}) error

OutputErr output to RWI.errorWriter

func (*RWI) OutputErrBytes

func (c *RWI) OutputErrBytes(data []byte) error

OutputErrBytes copy to RWI.errorWriter ([]byte data).

func (*RWI) OutputErrln

func (c *RWI) OutputErrln(val ...interface{}) error

OutputErrln output to RWI.errorWriter (add newline).

func (*RWI) Outputln

func (c *RWI) Outputln(val ...interface{}) error

Outputln output to RWI.writer (add newline).

func (*RWI) Reader

func (c *RWI) Reader() io.Reader

Reader returns RWI.reader

func (*RWI) WriteErrFrom

func (c *RWI) WriteErrFrom(r io.Reader) error

WriteErrFrom copy from io.Reader to RWI.errorWriter

func (*RWI) WriteFrom

func (c *RWI) WriteFrom(r io.Reader) error

WriteFrom copy from io.Reader to RWI.writer

func (*RWI) Writer

func (c *RWI) Writer() io.Writer

Writer returns RWI.writer

Jump to

Keyboard shortcuts

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