Documentation ¶
Overview ¶
Package io provides functionalities for io.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVDataWriter ¶
type CSVDataWriter struct {
// contains filtered or unexported fields
}
CSVDataWriter writes data in csv format.
func CSVWriter ¶
func CSVWriter(w io.Writer) *CSVDataWriter
CSVWriter initiates a new CSVDataWriter.
func (*CSVDataWriter) DataWriter ¶
func (w *CSVDataWriter) DataWriter() DataWriter
DataWriter provides a data writer.
func (*CSVDataWriter) WriteData ¶
func (w *CSVDataWriter) WriteData(v interface{}) error
WriteData writes data in csv format.
type DataWriter ¶
type DataWriter interface {
WriteData(v interface{}) error
}
DataWriter is the interface that wraps the basic WriteData method.
type DataWriterProvider ¶
type DataWriterProvider interface {
DataWriter() DataWriter
}
DataWriterProvider provides DataWriter.
type JSONDataWriter ¶
JSONDataWriter writes data as json.
func JSONWriter ¶
func JSONWriter(w io.Writer) *JSONDataWriter
JSONWriter initiates a new JSONDataWriter.
func (*JSONDataWriter) DataWriter ¶
func (w *JSONDataWriter) DataWriter() DataWriter
DataWriter provides a data writer.
func (*JSONDataWriter) WriteData ¶
func (w *JSONDataWriter) WriteData(v interface{}) error
WriteData writes data as json.
type StdioProvider ¶
type StdioProvider interface { OutOrStdout() io.Writer ErrOrStderr() io.Writer InOrStdin() io.Reader }
StdioProvider is a wrapper around *cobra.Command to provide stdin, stdout and stderr to survey.
func DefaultStdio ¶ added in v0.4.0
func DefaultStdio() StdioProvider
DefaultStdio returns default os.Stdin, os.Stdout and os.Stderr.
Click to show internal directories.
Click to hide internal directories.