Documentation
¶
Overview ¶
Package csv is a wrapper around the stdlib csv library that provides a nice API for the GTFS static parser.
Because, of course, everything can be solved with another layer of indirection.
Index ¶
- func BOMAwareCSVReader(reader io.Reader) *csv.Reader
- type File
- func (f *File) Close() error
- func (f *File) HeaderContent() []string
- func (p *File) MissingRequiredColumns() []string
- func (f *File) MissingRowKeys() []string
- func (f *File) Name() constants.StaticFile
- func (f *File) NextRow() bool
- func (f *File) OptionalColumn(s string) OptionalColumn
- func (f *File) RequiredColumn(s string) RequiredColumn
- func (f *File) RowContent() []string
- func (f *File) RowNumber() int
- type OptionalColumn
- type RequiredColumn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BOMAwareCSVReader ¶
From: https://stackoverflow.com/a/76023436
BOMAwareCSVReader will detect a UTF BOM (Byte Order Mark) at the start of the data and transform to UTF8 accordingly. If there is no BOM, it will read the data without any transformation.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func New ¶
func New(name constants.StaticFile, reader io.ReadCloser) (*File, error)
func (*File) HeaderContent ¶
func (*File) MissingRequiredColumns ¶
func (*File) MissingRowKeys ¶
func (*File) Name ¶
func (f *File) Name() constants.StaticFile
func (*File) OptionalColumn ¶
func (f *File) OptionalColumn(s string) OptionalColumn
func (*File) RequiredColumn ¶
func (f *File) RequiredColumn(s string) RequiredColumn
func (*File) RowContent ¶
type OptionalColumn ¶
type OptionalColumn struct {
// contains filtered or unexported fields
}
func (OptionalColumn) Read ¶
func (c OptionalColumn) Read() string
func (OptionalColumn) ReadOr ¶
func (c OptionalColumn) ReadOr(s string) string
type RequiredColumn ¶
type RequiredColumn struct {
// contains filtered or unexported fields
}
func (RequiredColumn) Read ¶
func (c RequiredColumn) Read() string
Click to show internal directories.
Click to hide internal directories.