csvformat

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMoviesFromText

func AddMoviesFromText() error

AddMoviesFromText uses the CSV parser with a string

func WriteCSVBuffer

func WriteCSVBuffer() (*bytes.Buffer, error)

WriteCSVBuffer returns a buffer csv for a set of books

func WriteCSVOutput

func WriteCSVOutput() error

WriteCSVOutput initializes a set of books and writes the to os.Stdout

Types

type Book

type Book struct {
	Author string
	Title  string
}

A Book has an Author and Title

type Books

type Books []Book

Books is a named type for an array of books

func (*Books) ToCSV

func (books *Books) ToCSV(w io.Writer) error

ToCSV takes a set of Books and writes to an io.Writer it returns any errors

type Movie

type Movie struct {
	Title    string
	Director string
	Year     int
}

Movie will hold our parsed CSV

func ReadCSV

func ReadCSV(b io.Reader) ([]Movie, error)

ReadCSV gives shows some examples of processing CSV that is passed in as an io.Reader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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