csv

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 7 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BOMAwareCSVReader

func BOMAwareCSVReader(reader io.Reader) *csv.Reader

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) Close

func (f *File) Close() error

func (*File) HeaderContent

func (f *File) HeaderContent() []string

func (*File) MissingRequiredColumns

func (p *File) MissingRequiredColumns() []string

func (*File) MissingRowKeys

func (f *File) MissingRowKeys() []string

func (*File) Name

func (f *File) Name() constants.StaticFile

func (*File) NextRow

func (f *File) NextRow() bool

func (*File) OptionalColumn

func (f *File) OptionalColumn(s string) OptionalColumn

func (*File) RequiredColumn

func (f *File) RequiredColumn(s string) RequiredColumn

func (*File) RowContent

func (f *File) RowContent() []string

func (*File) RowNumber

func (f *File) RowNumber() int

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL