csv

package module
v0.0.0-...-b0d1d9b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2015 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

csv GoDoc

Installation

go get github.ch/zbindenren.csv

Usage

See example.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoStruct           = errors.New("interface is not a struct")
	ErrNoValidRecords     = errors.New("no valid records found")
	ErrHeaderNotComplete  = errors.New("header not complete")
	ErrUnsupportedCSVType = errors.New("unsupported csv type")
)

Functions

This section is empty.

Types

type Marshaler

type Marshaler struct {
	Reader *csv.Reader
	Lazy   bool // if true, marshaler does not exit on first cvs.ParseError but continues and append all errors
	// contains filtered or unexported fields
}

Marshaler reads a csv file and unmarshalls it to an endpoint struct.

func NewMarshaler

func NewMarshaler(endPointStruct interface{}, r io.Reader) (*Marshaler, error)

NewMarshaler returns a new Marshaler

func (*Marshaler) Unmarshal

func (m *Marshaler) Unmarshal() ([]interface{}, error)

Unmarshal parses a csv file and stores its value to a list of entpoint structs

type ParseErrors

type ParseErrors []csv.ParseError

ParseErrors is a slice of csv.ParseError

func (ParseErrors) Error

func (errs ParseErrors) Error() string

Error returns te ParseErrors as string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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