converter

package
v0.0.0-...-639aee7 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatJSON = "json"
	FormatCSV  = "csv"
)

Conversion formats supported

Variables

View Source
var SupportedFormats = []string{FormatCSV, FormatJSON}

Functions

This section is empty.

Types

type CSVConverter

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

CSVConverter parses a CSV-parsable io.Reader It only parses files that adheres to the RFC 4180 standard

func NewCSVConverter

func NewCSVConverter(file io.Reader) *CSVConverter

NewCSVConverter constructs a new instance of CSVConverter and returns a pointer to it

func (*CSVConverter) Convert

func (c *CSVConverter) Convert(toFormat string, writer io.Writer) (int, error)

Convert converts the CSV file into the specified formats and writes it to the provided io.Writer

type Converter

type Converter interface {
	Convert(toFormat string, writer io.Writer) (int, error)
}

Converter interface is implemented by all supported file converters in the 'converter' package

Jump to

Keyboard shortcuts

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