adapters

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	SortAsc  = "asc"
	SortDesc = "desc"
)

Standardized sort directions. The empty string (default/omitted) means no sort.

Variables

This section is empty.

Functions

func ValidateSortDirection added in v1.3.3

func ValidateSortDirection(s string) error

ValidateSortDirection returns nil if s is empty, SortAsc, or SortDesc; otherwise it returns an error listing the valid values. Empty is treated as valid because callers conventionally use it to mean "no sort".

Types

type EntityCopier added in v1.0.0

type EntityCopier interface {
	CopyEntity(ent tt.Entity) error
	CopyEntities(ents []tt.Entity) error
	Reader() Reader
	Writer() Writer
}

type EntityReader added in v1.0.0

type EntityReader interface {
	Open() error
	Close() error
	ValidateStructure() []error
	String() string
	ReadEntities(c interface{}) error
}

EntityReader defines methods for opening a reader, validating its structure, and reading entities through reflection

type GtfsReader added in v1.0.0

type GtfsReader interface {
	gtfs.Reader
	StopTimesByTripID(...string) chan []gtfs.StopTime
	ShapesByShapeID(...string) chan []gtfs.Shape
}

GtfsReader defines methods for accessing core GTFS entities

type Reader

type Reader interface {
	EntityReader
	GtfsReader
}

Reader is the main interface for reading GTFS data

type SortableWriter added in v1.3.3

type SortableWriter interface {
	SetStandardizedSortOptions(StandardizedSortOptions)
}

SortableWriter is the minimal interface for accepting a sort config.

type StandardizedSortOptions added in v1.3.3

type StandardizedSortOptions struct {
	ApplySort   string   // SortAsc, SortDesc, or "" (no sort).
	SortColumns []string // Optional: specific columns to sort by. If empty, defaults are used.
}

type Writer

type Writer interface {
	Open() error
	Close() error
	Create() error
	Delete() error
	NewReader() (Reader, error)
	AddEntity(tt.Entity) (string, error)
	AddEntities([]tt.Entity) ([]string, error)
	String() string
}

Writer writes a GTFS feed.

type WriterWithExtraColumns

type WriterWithExtraColumns interface {
	Writer
	WriteExtraColumns(bool)
}

type WriterWithStandardizedSort added in v1.3.3

type WriterWithStandardizedSort interface {
	Writer
	SortableWriter
}

WriterWithStandardizedSort is a full Writer that also accepts sort config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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