Documentation
¶
Overview ¶
Package csv mainly implements the stream/file interface.
Index ¶
- func NewInStream(filename string) (file.InStream, error)
- func NewOutStream(filename string) (file.OutStream, error)
- func NewRows(f *os.File, c *config.JSON) (file.Rows, error)
- func NewWriter(f *os.File, c *config.JSON) (file.StreamWriter, error)
- type Column
- type Creator
- type InConfig
- type Opener
- type OutConfig
- type Rows
- type Stream
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInStream ¶
NewInStream - Creates a CSV input stream named 'filename'.
func NewOutStream ¶
NewOutStream - Creates a CSV output stream named 'filename'.
Types ¶
type Column ¶
type Column struct { Index string `json:"index"` // Index starts from 1 and represents the column number Type string `json:"type"` // Type (bool, bigInt, decimal, string, time) Format string `json:"format"` // Joda time format // contains filtered or unexported fields }
Column represents column information
type InConfig ¶
type InConfig struct { Columns []Column `json:"column"` // Column information Encoding string `json:"encoding"` // Encoding Delimiter string `json:"delimiter"` // Delimiter NullFormat string `json:"nullFormat"` // Null text StartRow int `json:"startRow"` // Starting row for reading, starting from 1 Comment string `json:"comment"` // Comments Compress string `json:"compress"` // Compression }
InConfig represents the CSV configuration
type OutConfig ¶
type OutConfig struct { Columns []Column `json:"column"` // Column information Encoding string `json:"encoding"` // Encoding Delimiter string `json:"delimiter"` // Delimiter NullFormat string `json:"nullFormat"` // Null text HasHeader bool `json:"hasHeader"` // Whether there is a column header Header []string `json:"header"` // Column header Compress string `json:"compress"` // Compression }
OutConfig represents the CSV configuration
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows - Represents a row reader for CSV data.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream - Represents a CSV file stream.
Click to show internal directories.
Click to hide internal directories.