Documentation
¶
Overview ¶
Package csv workers to read and write csv format
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder parse csv lines into key value pairs
func NewDecoder ¶
func NewDecoder(opts DecoderOptions) *Decoder
NewDecoder return a new csv decoder with given options
type DecoderOptions ¶
type DecoderOptions struct {
Header []string
Comma rune
Comment rune
Handler selina.ErrorHandler
Codec selina.Marshaler
}
DecoderOptions configure csv read format
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder transform messages into csv text
func NewEncoder ¶
func NewEncoder(opts EncoderOptions) *Encoder
NewEncoder returns a new Encoder with given options
type EncoderOptions ¶
type EncoderOptions struct {
// Header acts as a filter, if a field is not in header is skipped
Header []string
// Comma default ,
Comma rune
// UseCRLF use \r\n instead of \n
UseCRLF bool
Handler selina.ErrorHandler
ReadFormat selina.Unmarshaler
}
EncoderOptions configure csv encoding
Click to show internal directories.
Click to hide internal directories.