gocsv: github.com/hut8/gocsv Index | Files

package gocsv

import "github.com/hut8/gocsv"

Index

Package Files

csv.go decode.go encode.go reflect.go types.go

Variables

var FailIfUnmatchedStructTags = false

func DefaultCSVReader Uses

func DefaultCSVReader(in io.Reader) *csv.Reader

DefaultCSVReader is the default CSV reader used to parse CSV (cf. csv.NewReader)

func DefaultCSVWriter Uses

func DefaultCSVWriter(out io.Writer) *csv.Writer

DefaultCSVWriter is the default CSV writer used to format CSV (cf. csv.NewWriter)

func LazyCSVReader Uses

func LazyCSVReader(in io.Reader) *csv.Reader

LazyCSVReader returns a lazy CSV reader, with LazyQuotes and TrimLeadingSpace.

func Marshal Uses

func Marshal(in interface{}, out io.Writer) (err error)

Marshal returns the CSV in writer from the interface.

func MarshalBytes Uses

func MarshalBytes(in interface{}) (out []byte, err error)

MarshalBytes returns the CSV bytes from the interface.

func MarshalCSV Uses

func MarshalCSV(in interface{}, out *csv.Writer) (err error)

func MarshalFile Uses

func MarshalFile(in interface{}, file *os.File) (err error)

MarshalFile saves the interface as CSV in the file.

func MarshalString Uses

func MarshalString(in interface{}) (out string, err error)

MarshalString returns the CSV string from the interface.

func SetCSVReader Uses

func SetCSVReader(csvReader func(io.Reader) *csv.Reader)

SetCSVReader sets the CSV reader used to parse CSV.

func SetCSVWriter Uses

func SetCSVWriter(csvWriter func(io.Writer) *csv.Writer)

SetCSVWriter sets the CSV writer used to format CSV.

func Unmarshal Uses

func Unmarshal(in io.Reader, out interface{}) (err error)

Unmarshal parses the CSV from the reader in the interface.

func UnmarshalBytes Uses

func UnmarshalBytes(in []byte, out interface{}) (err error)

UnmarshalBytes parses the CSV from the bytes in the interface.

func UnmarshalCSV Uses

func UnmarshalCSV(in *csv.Reader, out interface{}) error

func UnmarshalFile Uses

func UnmarshalFile(in *os.File, out interface{}) (err error)

UnmarshalFile parses the CSV from the file in the interface.

func UnmarshalString Uses

func UnmarshalString(in string, out interface{}) (err error)

UnmarshalString parses the CSV from the string in the interface.

type Decoder Uses

type Decoder interface {
    // contains filtered or unexported methods
}

type Stringer Uses

type Stringer interface {
    String() string
}

Stringer is implemented by any value that has a String method This converter is used to convert the value to it string representation This converter will be used if your value does not implement TypeMarshaller

type TypeMarshaller Uses

type TypeMarshaller interface {
    MarshalCSV() (string, error)
}

TypeMarshaller is implemented by any value that has a MarshalCSV method This converter is used to convert the value to it string representation

type TypeUnmarshaller Uses

type TypeUnmarshaller interface {
    UnmarshalCSV(string) error
}

TypeUnmarshaller is implemented by any value that has an UnmarshalCSV method This converter is used to convert a string to your value representation of that string

Package gocsv imports 11 packages (graph) and is imported by 1 packages. Updated 2020-01-09. Refresh now. Tools for package owners.