Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Copier ¶
type Copier struct {
Reader tl.Reader
Writer tl.Writer
BatchSize int
// Attempt to save an entity that returns validation errors
AllowEntityErrors bool
AllowReferenceErrors bool
// Interpolate any missing StopTime values: ArrivalTime/DepartureTime/ShapeDistTraveled
InterpolateStopTimes bool
// Create a stop-to-stop Shape for Trips without a ShapeID.
CreateMissingShapes bool
// Create missing Calendar entries
NormalizeServiceIDs bool
// Convert extended route types to primitives
UseBasicRouteTypes bool
// Default AgencyID
DefaultAgencyID string
// Entity selection strategy
Marker Marker
// Error handler, called for each entity
ErrorHandler ErrorHandler
*tl.EntityMap
// contains filtered or unexported fields
}
Copier copies from Reader to Writer
func (*Copier) AddEntityFilter ¶
func (copier *Copier) AddEntityFilter(ef tl.EntityFilter) error
AddEntityFilter adds an EntityFilter to the copy process.
func (*Copier) AddExtension ¶
AddExtension adds an Extension to the copy process.
func (*Copier) Copy ¶
func (copier *Copier) Copy() *CopyResult
Copy copies Base GTFS entities from the Reader to the Writer, returning the summary as a CopyResult.
func (*Copier) CopyEntity ¶
CopyEntity performs validation and saves errors and warnings, returns new EntityID if written, otherwise an entity error or write error. An entity error means the entity was not not written because it had an error or was filtered out; not fatal. A write error should be considered fatal and should stop any further write attempts. Any errors and warnings are added to the CopyResult.
type CopyError ¶
type CopyError struct {
// contains filtered or unexported fields
}
CopyError wraps an underlying GTFS Error with the filename and entity ID.
func NewCopyError ¶
NewCopyError returns a new CopyError error with filename and id set.
type CopyResult ¶
type CopyResult struct {
WriteError error
Errors []error
Warnings []error
InterpolatedStopTimeCount int
EntityCount map[string]int
GeneratedCount map[string]int
SkipEntityErrorCount map[string]int
SkipEntityReferenceCount map[string]int
SkipEntityFilterCount map[string]int
SkipEntityMarkedCount map[string]int
}
CopyResult stores Copier results and statistics.
func (*CopyResult) DisplayErrors ¶
func (cr *CopyResult) DisplayErrors()
DisplayErrors shows individual errors in log.Info
func (*CopyResult) DisplaySummary ¶
func (cr *CopyResult) DisplaySummary()
DisplaySummary shows entity and error counts in log.Info
func (*CopyResult) HandleEntityErrors ¶
func (cr *CopyResult) HandleEntityErrors(ent tl.Entity, errs []error, warns []error)
HandleEntityErrors .
func (*CopyResult) HandleSourceErrors ¶
func (cr *CopyResult) HandleSourceErrors(fn string, errs []error, warns []error)
HandleSourceErrors .