Documentation
¶
Overview ¶
Package format package contains interfaces to implement to allow read/write of various file types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Readable ¶
type Readable interface {
// Initialize should initialize a encoding/<format> reader from the underlying file.
Initialize(file *os.File) error
// ReadHeader should return a list of column names.
ReadHeader() ([]string, error)
// ReadRecord should read a single record and return it as a map[string]string where column name is key and column value is value.
ReadRecord(headers []string) (map[string]string, error)
}
Readable is an interface for file types that can be read from.
type Writable ¶
type Writable interface {
// WriteHeader should be called at the beginning of the file write process.
WriteHeader(file *os.File, columns []string) error
// WriteRecord should be called for every record in the source data.
WriteRecord(file *os.File, row map[string]string, index int) error
WriteFooter(file *os.File) error
}
Writable is for file types that can be written to.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package csv contains implementation of format interfaces for CSV document type.
|
Package csv contains implementation of format interfaces for CSV document type. |
|
Package json contains implementation of format interfaces for JSON document type.
|
Package json contains implementation of format interfaces for JSON document type. |
Click to show internal directories.
Click to hide internal directories.