Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads and decodes a csv into an array from an input stream
func NewDecoder ¶
NewDecoder creates a new decoder from the given reader
func (*Decoder) Decode ¶
Decode decodes the reader into the value v v must be an array of structs, where the struct field names (or tags) define the csv header name to decode from Will decode most built in types, otherwise it will use the FromString interface to decode
func (*Decoder) DisableTrimLeadingSpace ¶
func (d *Decoder) DisableTrimLeadingSpace()
DisableTrimLeadingSpace sets the value for the underlying reader to false. If TrimLeadingSpace is true, leading white space in a field is ignored. This is done even if the field delimiter is white space.
func (*Decoder) SetComment ¶
SetComment character for the csv reader
func (*Decoder) SetDelimiter ¶
SetDelimiter character for the csv reader
func (*Decoder) TrimLeadingSpace ¶
func (d *Decoder) TrimLeadingSpace()
TrimLeadingSpace the value for the underlying reader to true. If TrimLeadingSpace is true, leading white space in a field is ignored. This is done even if the field delimiter is white space.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes and writes the contents of a slice into a csv file
func NewEncoder ¶
NewEncoder creates a new encoder from the given writer
func (*Encoder) NoCRLF ¶
func (e *Encoder) NoCRLF()
NoCRLF disables CRLF line ending for the csv Writer
func (*Encoder) SetDelimiter ¶
SetDelimiter character for the csv reader
type MarshalCSV ¶
type MarshalCSV interface {
MarshalCSV() string
}
MarshalCSV describes how CSV should handle types that aren't strings or built in
type UnmarshalCSV ¶
UnmarshalCSV describes how CSV should handle types that aren't strings or built in