csv

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 6 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 added in v0.1.15

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(reader io.ReadCloser) (*File, error)

func (*File) Close added in v0.1.13

func (f *File) Close() error

func (*File) MissingRequiredColumns added in v0.1.13

func (p *File) MissingRequiredColumns() error

func (*File) MissingRowKeys added in v0.1.13

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

func (*File) NextRow added in v0.1.13

func (f *File) NextRow() bool

func (*File) OptionalColumn added in v0.1.13

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

func (*File) RequiredColumn added in v0.1.13

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

type OptionalColumn added in v0.1.13

type OptionalColumn struct {
	// contains filtered or unexported fields
}

func (OptionalColumn) Read added in v0.1.13

func (c OptionalColumn) Read() string

func (OptionalColumn) ReadOr added in v0.1.13

func (c OptionalColumn) ReadOr(s string) string

type RequiredColumn added in v0.1.13

type RequiredColumn struct {
	// contains filtered or unexported fields
}

func (RequiredColumn) Read added in v0.1.13

func (c RequiredColumn) Read() string

Jump to

Keyboard shortcuts

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