Documentation ¶
Overview ¶
Package rwi : Reader/Writer Interface for command-line
These codes are licensed under CC0. http://creativecommons.org/publicdomain/zero/1.0/
Index ¶
- type OptFunc
- type RWI
- func (c *RWI) ErrorWriter() io.Writer
- func (c *RWI) Output(val ...interface{}) error
- func (c *RWI) OutputBytes(data []byte) error
- func (c *RWI) OutputErr(val ...interface{}) error
- func (c *RWI) OutputErrBytes(data []byte) error
- func (c *RWI) OutputErrln(val ...interface{}) error
- func (c *RWI) Outputln(val ...interface{}) error
- func (c *RWI) Reader() io.Reader
- func (c *RWI) WriteErrFrom(r io.Reader) error
- func (c *RWI) WriteFrom(r io.Reader) error
- func (c *RWI) Writer() io.Writer
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 WithErrorWriter ¶ added in v0.6.0
WithErrorWriter returns function for setting Writer (error)
func WithReader ¶ added in v0.6.0
WithReader returns function for setting Reader
func WithWriter ¶ added in v0.6.0
WithWriter returns function for setting Writer
type RWI ¶
type RWI struct {
// contains filtered or unexported fields
}
RWI is Reader/Writer class for command-line
func (*RWI) OutputBytes ¶
OutputBytes to RWI.writer ([]byte data).
func (*RWI) OutputErrBytes ¶
OutputErrBytes copy to RWI.errorWriter ([]byte data).
func (*RWI) OutputErrln ¶
OutputErrln output to RWI.errorWriter (add newline).
func (*RWI) WriteErrFrom ¶
WriteErrFrom copy from io.Reader to RWI.errorWriter
Click to show internal directories.
Click to hide internal directories.