io

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 4 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.

func DefaultStdio added in v0.4.0

func DefaultStdio() StdioProvider

DefaultStdio returns default os.Stdin, os.Stdout and os.Stderr.

func Stdio added in v0.4.0

func Stdio(stdin io.Reader, stdout io.Writer, stderr io.Writer) StdioProvider

Stdio creates a new provider with then given stdio.

Jump to

Keyboard shortcuts

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