io

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 3 Imported by: 0

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

type JSONDataWriter struct {
	*json.Encoder
}

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.

Jump to

Keyboard shortcuts

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