tl

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GTFSRTVERSION = "99fdfba627451d2861346c631af84535fa1e02fb"

GTFSRTVERSION is the commit for the gtfs-realtime.proto file.

View Source
var GTFSVERSION = "2e6887ea16b689d8ebc70ad334ac8abb2f94a66e"

GTFSVERSION is the commit for the spec reference.md file.

View Source
var VERSION = "v0.10.2"

VERSION is the current software version.

Functions

func SecondsToString

func SecondsToString(secs int) string

SecondsToString takes seconds-since-midnight and returns a GTFS-style time.

func StringToSeconds

func StringToSeconds(value string) (int, error)

StringToSeconds parses a GTFS-style time and returns seconds since midnight.

func ValidateShapes

func ValidateShapes(shapes []Shape) []error

ValidateShapes returns errors for an array of shapes.

func ValidateStopTimes

func ValidateStopTimes(stoptimes []StopTime) []error

ValidateStopTimes checks if the trip follows GTFS rules.

Types

type Agency

type Agency struct {
	AgencyID       string
	AgencyName     string `csv:",required"`
	AgencyURL      string `csv:",required"`
	AgencyTimezone string `csv:",required"`
	AgencyLang     string
	AgencyPhone    string
	AgencyFareURL  string
	AgencyEmail    string
	BaseEntity
}

Agency agency.txt

func (*Agency) EntityID

func (ent *Agency) EntityID() string

EntityID returns the ID or AgencyID.

func (*Agency) EntityKey added in v0.7.1

func (ent *Agency) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Agency) Errors

func (ent *Agency) Errors() (errs []error)

Errors for this Entity.

func (*Agency) Filename

func (ent *Agency) Filename() string

Filename agency.txt

func (*Agency) TableName

func (ent *Agency) TableName() string

TableName gtfs_agencies

type Attribution added in v0.10.0

type Attribution struct {
	OrganizationName String
	AgencyID         Key
	RouteID          Key
	TripID           Key
	IsProducer       Int
	IsOperator       Int
	IsAuthority      Int
	AttributionID    String
	AttributionURL   String
	AttributionEmail String
	AttributionPhone String
	BaseEntity
}

func (*Attribution) Errors added in v0.10.0

func (ent *Attribution) Errors() (errs []error)

Errors for this Entity.

func (*Attribution) Filename added in v0.10.0

func (ent *Attribution) Filename() string

func (*Attribution) TableName added in v0.10.0

func (ent *Attribution) TableName() string

func (*Attribution) UpdateKeys added in v0.10.0

func (ent *Attribution) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type Calendar

type Calendar struct {
	ServiceID string    `csv:",required"`
	Monday    int       `csv:",required"`
	Tuesday   int       `csv:",required"`
	Wednesday int       `csv:",required"`
	Thursday  int       `csv:",required"`
	Friday    int       `csv:",required"`
	Saturday  int       `csv:",required"`
	Sunday    int       `csv:",required"`
	StartDate time.Time `csv:",required"`
	EndDate   time.Time `csv:",required"`
	Generated bool      `csv:"-" db:"generated"`
	BaseEntity
}

Calendar calendars.txt

func (*Calendar) EntityID

func (ent *Calendar) EntityID() string

EntityID returns the ID or ServiceID.

func (*Calendar) EntityKey added in v0.7.1

func (ent *Calendar) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Calendar) Errors

func (ent *Calendar) Errors() (errs []error)

Errors for this Entity.

func (*Calendar) Filename

func (ent *Calendar) Filename() string

Filename calendar.txt

func (*Calendar) TableName

func (ent *Calendar) TableName() string

TableName gtfs_calendars

type CalendarDate

type CalendarDate struct {
	ServiceID     string    `csv:",required"`
	Date          time.Time `csv:",required"`
	ExceptionType int       `csv:",required"`
	BaseEntity
}

CalendarDate calendar_dates.txt

func (*CalendarDate) Errors

func (ent *CalendarDate) Errors() (errs []error)

Errors for this Entity.

func (*CalendarDate) Filename

func (ent *CalendarDate) Filename() string

Filename calendar_dates.txt

func (*CalendarDate) TableName

func (ent *CalendarDate) TableName() string

TableName gtfs_calendar_dates

func (*CalendarDate) UpdateKeys

func (ent *CalendarDate) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type DatabaseEntity added in v0.8.8

type DatabaseEntity struct {
	ID int `csv:"-"`
}

func (*DatabaseEntity) GetID added in v0.8.8

func (ent *DatabaseEntity) GetID() int

GetID returns the integer ID.

func (*DatabaseEntity) SetID added in v0.8.8

func (ent *DatabaseEntity) SetID(id int)

SetID sets the integer ID.

type Date added in v0.10.1

type Date struct {
	Time  time.Time
	Valid bool
}

Date is a nullable date, but can scan strings

func NewDate added in v0.10.1

func NewDate(v time.Time) Date

func NewODate added in v0.8.4

func NewODate(v time.Time) Date

func (*Date) IsZero added in v0.10.1

func (r *Date) IsZero() bool

IsZero returns if this is a zero value.

func (Date) MarshalGQL added in v0.10.1

func (r Date) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Date) MarshalJSON added in v0.10.1

func (r *Date) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Date) Scan added in v0.10.1

func (r *Date) Scan(src interface{}) error

Scan implements sql.Scanner

func (*Date) String added in v0.10.1

func (r *Date) String() string

func (*Date) UnmarshalGQL added in v0.10.1

func (r *Date) UnmarshalGQL(src interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Date) UnmarshalJSON added in v0.10.1

func (r *Date) UnmarshalJSON(v []byte) error

UnmarshalJSON implements the json.Marshaler interface

func (Date) Value added in v0.10.1

func (r Date) Value() (driver.Value, error)

Value returns nil if empty

type Entity

type Entity interface {
	EntityID() string
	Filename() string
	Errors() []error
	Warnings() []error
	AddError(error)
	AddWarning(error)
	SetExtra(string, string)
	Extra() map[string]string
	UpdateKeys(*EntityMap) error
}

Entity provides an interface for GTFS entities.

type EntityError

type EntityError interface {
	Error() string
}

EntityError is an interface for GTFS Errors

type EntityMap

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

EntityMap stores correspondances between Entity IDs, e.g. StopID -> Stop's integer ID in a database.

func NewEntityMap

func NewEntityMap() *EntityMap

NewEntityMap returns a new EntityMap.

func (*EntityMap) Get

func (emap *EntityMap) Get(efn string, eid string) (string, bool)

Get gets directly by filename, eid

func (*EntityMap) GetEntity

func (emap *EntityMap) GetEntity(ent Entity) (string, bool)

GetEntity returns the new ID for an Entity.

func (*EntityMap) KeysFor

func (emap *EntityMap) KeysFor(efn string) []string

KeysFor returns the keys for a filename.

func (*EntityMap) Set

func (emap *EntityMap) Set(efn string, oldid string, newid string) error

Set directly adds an entry to the set.

func (*EntityMap) SetEntity

func (emap *EntityMap) SetEntity(ent Entity, oldid string, newid string) error

SetEntity sets the old and new ID for an Entity.

func (*EntityMap) Update

func (emap *EntityMap) Update(other EntityMap)

Update copies values from another EntityMap.

type FareAttribute

type FareAttribute struct {
	FareID           string  `csv:",required"`
	Price            float64 `csv:",required"`
	CurrencyType     string  `csv:",required"`
	PaymentMethod    int     `csv:",required"`
	Transfers        Int
	AgencyID         Key
	TransferDuration int
	BaseEntity
}

FareAttribute fare_attributes.txt

func (*FareAttribute) EntityID

func (ent *FareAttribute) EntityID() string

EntityID returns the ID or FareID.

func (*FareAttribute) EntityKey added in v0.7.1

func (ent *FareAttribute) EntityKey() string

EntityKey returns the GTFS identifier.

func (*FareAttribute) Errors

func (ent *FareAttribute) Errors() (errs []error)

Errors for this Entity.

func (*FareAttribute) Filename

func (ent *FareAttribute) Filename() string

Filename fare_attributes.txt

func (*FareAttribute) TableName

func (ent *FareAttribute) TableName() string

TableName gtfs_fare_attributes

func (*FareAttribute) UpdateKeys

func (ent *FareAttribute) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type FareRule

type FareRule struct {
	FareID        string `csv:",required"`
	RouteID       Key
	OriginID      string
	DestinationID string
	ContainsID    string
	BaseEntity
}

FareRule fare_rules.txt

func (*FareRule) Errors

func (ent *FareRule) Errors() (errs []error)

Errors for this Entity.

func (*FareRule) Filename

func (ent *FareRule) Filename() string

Filename fare_rules.txt

func (*FareRule) TableName

func (ent *FareRule) TableName() string

TableName gtfs_fare_Rules

func (*FareRule) UpdateKeys

func (ent *FareRule) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type Feed

type Feed struct {
	ID            int               `json:"-"`
	FeedID        string            `json:"id" db:"onestop_id"`
	Name          String            `json:"name,omitempty"`
	Spec          string            `json:"spec,omitempty"`
	URLs          FeedUrls          `json:"urls,omitempty" db:"urls"`
	Languages     FeedLanguages     `json:"languages,omitempty"`
	License       FeedLicense       `json:"license,omitempty"`
	Authorization FeedAuthorization `json:"authorization,omitempty" db:"auth"`
	Tags          Tags              `json:"tags,omitempty" db:"feed_tags" `
	File          string            `json:"-"` // internal
	DeletedAt     Time              `json:"-"` // internal
	Timestamps    `json:"-"`        // internal
}

Feed listed in a parsed DMFR file

func (*Feed) EntityID

func (ent *Feed) EntityID() string

EntityID .

func (*Feed) Equal added in v0.8.5

func (ent *Feed) Equal(other *Feed) bool

Equal compares the JSON representation of two feeds

func (*Feed) GetID added in v0.7.1

func (ent *Feed) GetID() int

GetID .

func (*Feed) MatchSecrets added in v0.10.1

func (ent *Feed) MatchSecrets(secrets []Secret) (Secret, error)

func (*Feed) SetID added in v0.7.1

func (ent *Feed) SetID(id int)

SetID .

func (Feed) TableName

func (Feed) TableName() string

TableName .

type FeedAssociatedFeeds

type FeedAssociatedFeeds []string

FeedAssociatedFeeds .

func (*FeedAssociatedFeeds) Scan

func (a *FeedAssociatedFeeds) Scan(value interface{}) error

Scan .

func (FeedAssociatedFeeds) Value

func (a FeedAssociatedFeeds) Value() (driver.Value, error)

Value .

type FeedAuthorization

type FeedAuthorization struct {
	Type      string `json:"type,omitempty"` // ["header", "basic_auth", "query_param", "path_segment"]
	ParamName string `json:"param_name,omitempty"`
	InfoURL   string `json:"info_url,omitempty"`
}

FeedAuthorization contains details about how to access a Feed.

func (*FeedAuthorization) Scan

func (a *FeedAuthorization) Scan(value interface{}) error

Scan .

func (FeedAuthorization) Value

func (a FeedAuthorization) Value() (driver.Value, error)

Value .

type FeedInfo

type FeedInfo struct {
	FeedPublisherName string `csv:",required"`
	FeedPublisherURL  string `csv:",required"`
	FeedLang          string `csv:",required"`
	FeedVersion       string `db:"feed_version_name"`
	FeedStartDate     Date
	FeedEndDate       Date
	DefaultLang       String
	FeedContactEmail  String
	FeedContactURL    String
	BaseEntity
}

FeedInfo feed_info.txt

func (*FeedInfo) Errors

func (ent *FeedInfo) Errors() (errs []error)

Errors for this Entity.

func (*FeedInfo) Filename

func (ent *FeedInfo) Filename() string

Filename feed_info.txt

func (*FeedInfo) TableName

func (ent *FeedInfo) TableName() string

TableName gtfs_feed_infos

type FeedLanguages

type FeedLanguages []string

FeedLanguages .

func (*FeedLanguages) Scan

func (a *FeedLanguages) Scan(value interface{}) error

Scan .

func (FeedLanguages) Value

func (a FeedLanguages) Value() (driver.Value, error)

Value .

type FeedLicense

type FeedLicense struct {
	SpdxIdentifier          string `json:"spdx_identifier,omitempty"`
	URL                     string `json:"url,omitempty"`
	UseWithoutAttribution   string `json:"use_without_attribution,omitempty"`
	CreateDerivedProduct    string `json:"create_derived_product,omitempty"`
	RedistributionAllowed   string `json:"redistribution_allowed,omitempty"`
	CommercialUseAllowed    string `json:"commercial_use_allowed,omitempty"`
	ShareAlikeOptional      string `json:"share_alike_optional,omitempty"`
	AttributionText         string `json:"attribution_text,omitempty"`
	AttributionInstructions string `json:"attribution_instructions,omitempty"`
}

FeedLicense describes the license and usage information for a Feed.

func (*FeedLicense) Scan

func (a *FeedLicense) Scan(value interface{}) error

Scan .

func (FeedLicense) Value

func (a FeedLicense) Value() (driver.Value, error)

Value .

type FeedUrls

type FeedUrls struct {
	StaticCurrent            string   `json:"static_current,omitempty"`
	StaticPlanned            string   `json:"static_planner,omitempty"`
	StaticHistoric           []string `json:"static_historic,omitempty"`
	RealtimeVehiclePositions string   `json:"realtime_vehicle_positions,omitempty"`
	RealtimeTripUpdates      string   `json:"realtime_trip_updates,omitempty"`
	RealtimeAlerts           string   `json:"realtime_alerts,omitempty"`
	GbfsAutoDiscovery        string   `json:"gbfs_auto_discovery,omitempty"`
	GbfsSystemAlerts         string   `json:"gbfs_system_alerts,omitempty"`
	MdsProvider              string   `json:"mds_provider,omitempty"`
}

FeedUrls contains URL values for a Feed.

func (*FeedUrls) Scan

func (a *FeedUrls) Scan(value interface{}) error

Scan .

func (FeedUrls) Value

func (a FeedUrls) Value() (driver.Value, error)

Value .

type FeedVersion

type FeedVersion struct {
	ID                   int
	FeedID               int
	FeedType             string
	SHA1                 string
	SHA1Dir              string
	File                 string
	URL                  string
	EarliestCalendarDate Date
	LatestCalendarDate   Date
	FetchedAt            time.Time
	Name                 String
	Description          String
	CreatedBy            String
	UpdatedBy            String
	Timestamps
}

FeedVersion represents a single GTFS data source.

func NewFeedVersionFromReader

func NewFeedVersionFromReader(reader Reader) (FeedVersion, error)

NewFeedVersionFromReader returns a FeedVersion from a Reader.

func (*FeedVersion) EntityID

func (ent *FeedVersion) EntityID() string

EntityID .

func (*FeedVersion) GetID added in v0.7.1

func (ent *FeedVersion) GetID() int

GetID .

func (*FeedVersion) SetID added in v0.7.1

func (ent *FeedVersion) SetID(id int)

SetID .

func (*FeedVersion) TableName

func (ent *FeedVersion) TableName() string

TableName sets the table name prefix.

type FeedVersionEntity added in v0.8.8

type FeedVersionEntity struct {
	FeedVersionID int `csv:"-"`
}

func (*FeedVersionEntity) SetFeedVersionID added in v0.8.8

func (ent *FeedVersionEntity) SetFeedVersionID(fvid int)

SetFeedVersionID sets the Entity's FeedVersionID.

type Float added in v0.10.1

type Float struct {
	Valid bool
	Float float64
}

func NewFloat added in v0.10.1

func NewFloat(v float64) Float

func NewOFloat added in v0.8.0

func NewOFloat(v float64) Float

func (Float) MarshalGQL added in v0.10.1

func (r Float) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Float) MarshalJSON added in v0.10.1

func (r *Float) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Float) Scan added in v0.10.1

func (r *Float) Scan(src interface{}) error

Scan implements sql.Scanner

func (*Float) String added in v0.10.1

func (r *Float) String() string

func (*Float) UnmarshalGQL added in v0.10.1

func (r *Float) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Float) UnmarshalJSON added in v0.10.1

func (r *Float) UnmarshalJSON(v []byte) error

UnmarshalJSON implements the json.marshaler interface.

func (Float) Value added in v0.10.1

func (r Float) Value() (driver.Value, error)

Value returns nil if empty

type Frequency

type Frequency struct {
	TripID      string `csv:",required"`
	HeadwaySecs int    `csv:",required"`
	StartTime   WideTime
	EndTime     WideTime
	ExactTimes  int
	BaseEntity
}

Frequency frequencies.txt

func (*Frequency) Errors

func (ent *Frequency) Errors() (errs []error)

Errors for this Entity.

func (*Frequency) Filename

func (ent *Frequency) Filename() string

Filename frequencies.txt

func (*Frequency) RepeatCount added in v0.7.1

func (ent *Frequency) RepeatCount() int

RepeatCount returns the number of times this trip will be repeated.

func (*Frequency) TableName

func (ent *Frequency) TableName() string

TableName gtfs_frequencies

func (*Frequency) UpdateKeys

func (ent *Frequency) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type Geometry added in v0.8.0

type Geometry struct {
	Valid    bool
	Geometry geom.T
}

Geometry is an EWKB/GeoJSON wrapper for arbitary geometry.

func (Geometry) MarshalGQL added in v0.8.0

func (g Geometry) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Geometry) MarshalJSON added in v0.8.0

func (g *Geometry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Geometry) Scan added in v0.8.0

func (g *Geometry) Scan(src interface{}) error

Scan implements the Scanner interface

func (Geometry) String added in v0.8.8

func (g Geometry) String() string

String returns the GeoJSON representation

func (*Geometry) UnmarshalGQL added in v0.8.0

func (g *Geometry) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (Geometry) Value added in v0.8.0

func (g Geometry) Value() (driver.Value, error)

Value implements driver.Value

type Int added in v0.10.1

type Int struct {
	Valid bool
	Int   int
}

func NewInt added in v0.10.1

func NewInt(v int) Int

func NewOInt added in v0.8.0

func NewOInt(v int) Int

func (Int) MarshalGQL added in v0.10.1

func (r Int) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Int) MarshalJSON added in v0.10.1

func (r *Int) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Int) Scan added in v0.10.1

func (r *Int) Scan(src interface{}) error

Scan implements sql.Scanner

func (*Int) String added in v0.10.1

func (r *Int) String() string

func (*Int) UnmarshalGQL added in v0.10.1

func (r *Int) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Int) UnmarshalJSON added in v0.10.1

func (r *Int) UnmarshalJSON(v []byte) error

UnmarshalJSON implements the json.marshaler interface.

func (Int) Value added in v0.10.1

func (r Int) Value() (driver.Value, error)

Value returns nil if empty

type IntSlice added in v0.10.0

type IntSlice struct {
	Valid bool
	Ints  []int
}

IntSlice .

func NewIntSlice added in v0.10.1

func NewIntSlice(v []int) IntSlice

func (*IntSlice) Scan added in v0.10.0

func (a *IntSlice) Scan(value interface{}) error

Scan .

func (IntSlice) Value added in v0.10.0

func (a IntSlice) Value() (driver.Value, error)

Value .

type Key added in v0.10.1

type Key struct {
	Key   string
	Valid bool
}

Key is a nullable foreign key constraint, similar to sql.NullString

func NewKey added in v0.10.1

func NewKey(v string) Key

func NewOKey added in v0.8.0

func NewOKey(v string) Key

func (*Key) Int added in v0.10.1

func (r *Key) Int() int

func (Key) MarshalGQL added in v0.10.1

func (r Key) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Key) MarshalJSON added in v0.10.1

func (r *Key) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Key) Scan added in v0.10.1

func (r *Key) Scan(src interface{}) error

Scan implements sql.Scanner

func (*Key) String added in v0.10.1

func (r *Key) String() string

func (*Key) UnmarshalGQL added in v0.10.1

func (r *Key) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Key) UnmarshalJSON added in v0.10.1

func (r *Key) UnmarshalJSON(v []byte) error

UnmarshalJSON implements the json.marshaler interface.

func (Key) Value added in v0.10.1

func (r Key) Value() (driver.Value, error)

Value returns nil if empty

type Level

type Level struct {
	LevelID    string  `csv:",required"`
	LevelIndex float64 `csv:",required"`
	LevelName  string  `csv:"level_name"`
	BaseEntity
}

Level levels.txt

func (*Level) EntityID

func (ent *Level) EntityID() string

EntityID returns the ID or StopID.

func (*Level) EntityKey added in v0.7.1

func (ent *Level) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Level) Filename

func (ent *Level) Filename() string

Filename levels.txt

func (*Level) TableName

func (ent *Level) TableName() string

TableName ext_pathways_levels

type LineString

type LineString struct {
	Valid bool
	geom.LineString
}

LineString is an EWKB/SL encoded LineString

func NewLineStringFromFlatCoords

func NewLineStringFromFlatCoords(coords []float64) LineString

NewLineStringFromFlatCoords returns a new LineString from flat (3) coordinates

func (LineString) MarshalGQL added in v0.7.2

func (g LineString) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*LineString) MarshalJSON added in v0.8.0

func (g *LineString) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*LineString) Scan

func (g *LineString) Scan(src interface{}) error

Scan implements Scanner

func (LineString) String added in v0.8.8

func (g LineString) String() string

String returns the GeoJSON representation

func (*LineString) UnmarshalGQL added in v0.7.2

func (g *LineString) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (LineString) Value

func (g LineString) Value() (driver.Value, error)

Value implements driver.Value

type MinEntity added in v0.8.8

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

MinEntity provides default methods.

func (*MinEntity) AddError added in v0.8.8

func (ent *MinEntity) AddError(err error)

AddError adds a loading error to the entity, e.g. from a CSV parse failure

func (*MinEntity) AddWarning added in v0.8.8

func (ent *MinEntity) AddWarning(err error)

AddWarning .

func (*MinEntity) EntityID added in v0.8.8

func (ent *MinEntity) EntityID() string

EntityID returns the entity ID.

func (*MinEntity) Errors added in v0.8.8

func (ent *MinEntity) Errors() []error

Errors returns validation errors.

func (*MinEntity) Extra added in v0.8.8

func (ent *MinEntity) Extra() map[string]string

Extra provides any additional fields that were present.

func (*MinEntity) Filename added in v0.8.8

func (ent *MinEntity) Filename() string

Filename returns the filename for this entity.

func (*MinEntity) SetExtra added in v0.8.8

func (ent *MinEntity) SetExtra(key string, value string)

SetExtra adds a string key, value pair to the entity's extra fields.

func (*MinEntity) UpdateKeys added in v0.8.8

func (ent *MinEntity) UpdateKeys(emap *EntityMap) error

UpdateKeys updates entity referencespdates foreign keys based on an EntityMap.

func (*MinEntity) Warnings added in v0.10.0

func (ent *MinEntity) Warnings() []error

Errors returns validation errors.

type NullWriter added in v0.8.5

type NullWriter struct {
}

NullWriter is a no-op writer.

func (*NullWriter) AddEntities added in v0.8.5

func (*NullWriter) AddEntities(ents []Entity) ([]string, error)

func (*NullWriter) AddEntity added in v0.8.5

func (*NullWriter) AddEntity(ent Entity) (string, error)

func (*NullWriter) Close added in v0.8.5

func (*NullWriter) Close() error

func (*NullWriter) Create added in v0.8.5

func (*NullWriter) Create() error

func (*NullWriter) Delete added in v0.8.5

func (*NullWriter) Delete() error

func (*NullWriter) NewReader added in v0.8.5

func (*NullWriter) NewReader() (Reader, error)

func (*NullWriter) Open added in v0.8.5

func (*NullWriter) Open() error

func (*NullWriter) String added in v0.10.1

func (*NullWriter) String() string

type ODate added in v0.8.4

type ODate = Date

type OFloat added in v0.8.0

type OFloat = Float

type OInt added in v0.8.0

type OInt = Int

type OKey added in v0.8.0

type OKey = Key

type OString added in v0.8.0

type OString = String

type OTime added in v0.8.3

type OTime = Time

type Operator added in v0.8.5

type Operator struct {
	ID              int                     `json:"-"`
	OnestopID       String                  `json:"onestop_id"`
	Name            String                  `json:"name,omitempty"`
	ShortName       String                  `json:"short_name,omitempty"`
	Website         String                  `json:"website,omitempty"`
	AssociatedFeeds OperatorAssociatedFeeds `json:"associated_feeds,omitempty"`
	Tags            Tags                    `json:"tags,omitempty" db:"operator_tags"`
	File            String                  `json:"-"` // internal
	DeletedAt       Time                    `json:"-"` // internal
	Timestamps      `json:"-"`
}

func (*Operator) Equal added in v0.8.5

func (ent *Operator) Equal(other *Operator) bool

Equal compares the JSON representation of two operators.

func (*Operator) GetID added in v0.8.5

func (ent *Operator) GetID() int

GetID .

func (*Operator) SetID added in v0.8.5

func (ent *Operator) SetID(id int)

SetID .

func (Operator) TableName added in v0.8.5

func (Operator) TableName() string

TableName .

type OperatorAssociatedFeed added in v0.8.5

type OperatorAssociatedFeed struct {
	GtfsAgencyID         String `json:"gtfs_agency_id,omitempty" db:"gtfs_agency_id"`
	FeedOnestopID        String `json:"feed_onestop_id,omitempty" db:"-"`
	ResolvedOnestopID    String `json:"-"` // internal
	ResolvedGtfsAgencyID String `json:"-"` // internal
	ResolvedName         String `json:"-"` // internal
	ResolvedShortName    String `json:"-"` // internal
	ResolvedPlaces       String `json:"-"` // internal
	OperatorID           Int    `json:"-"` // internal
	ID                   int    `json:"-"` // internal
	FeedID               int    `json:"-"` // internal
}

func (OperatorAssociatedFeed) TableName added in v0.8.5

func (o OperatorAssociatedFeed) TableName() string

type OperatorAssociatedFeeds added in v0.8.5

type OperatorAssociatedFeeds []OperatorAssociatedFeed

OperatorAssociatedFeeds is necessary to scan correctly from database

func (OperatorAssociatedFeeds) MarshalGQL added in v0.8.5

func (r OperatorAssociatedFeeds) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*OperatorAssociatedFeeds) Scan added in v0.8.5

func (a *OperatorAssociatedFeeds) Scan(value interface{}) error

Scan .

func (*OperatorAssociatedFeeds) UnmarshalGQL added in v0.8.5

func (r *OperatorAssociatedFeeds) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (OperatorAssociatedFeeds) Value added in v0.8.5

Value .

type Pathway

type Pathway struct {
	PathwayID           string  `csv:",required"`
	FromStopID          string  `csv:",required"`
	ToStopID            string  `csv:",required"`
	PathwayMode         int     `csv:",required"`
	IsBidirectional     int     `csv:",required"`
	Length              float64 `csv:"length" min:"0"`
	TraversalTime       int     `csv:"traversal_time" min:"0"`
	StairCount          int     `csv:"stair_count"`
	MaxSlope            float64 `csv:"max_slope"`
	MinWidth            float64 `csv:"min_width"`
	SignpostedAs        string  `csv:"signposted_as"`
	ReverseSignpostedAs string  `csv:"reversed_signposted_as"`
	BaseEntity
}

Pathway pathways.txt

func (*Pathway) EntityID

func (ent *Pathway) EntityID() string

EntityID returns the ID or StopID.

func (*Pathway) EntityKey added in v0.7.1

func (ent *Pathway) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Pathway) Filename

func (ent *Pathway) Filename() string

Filename pathways.txt

func (*Pathway) GetString

func (ent *Pathway) GetString(key string) (string, error)

GetString returns the string representation of an field.

func (*Pathway) TableName

func (ent *Pathway) TableName() string

TableName ext_pathway_pathways

func (*Pathway) UpdateKeys

func (ent *Pathway) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type Point

type Point struct {
	Valid bool
	geom.Point
}

Point is an EWKB/SL encoded point

func NewPoint

func NewPoint(lon, lat float64) Point

NewPoint returns a Point from lon, lat

func (Point) MarshalGQL added in v0.7.2

func (g Point) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Point) MarshalJSON added in v0.8.0

func (g *Point) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Point) Scan

func (g *Point) Scan(src interface{}) error

Scan implements Scanner

func (Point) String added in v0.8.8

func (g Point) String() string

String returns the GeoJSON representation

func (*Point) UnmarshalGQL added in v0.7.2

func (g *Point) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (Point) Value

func (g Point) Value() (driver.Value, error)

Value implements driver.Value

type Polygon added in v0.7.2

type Polygon struct {
	Valid bool
	geom.Polygon
}

Polygon is an EWKB/SL encoded Polygon

func (Polygon) MarshalGQL added in v0.7.2

func (g Polygon) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Polygon) MarshalJSON added in v0.8.0

func (g *Polygon) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Polygon) Scan added in v0.7.2

func (g *Polygon) Scan(src interface{}) error

Scan implements Scanner

func (Polygon) String added in v0.8.8

func (g Polygon) String() string

String returns the GeoJSON representation

func (*Polygon) UnmarshalGQL added in v0.7.2

func (g *Polygon) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (Polygon) Value added in v0.7.2

func (g Polygon) Value() (driver.Value, error)

Value implements driver.Value

type Reader

type Reader interface {
	Open() error
	Close() error
	ValidateStructure() []error
	StopTimesByTripID(...string) chan []StopTime
	String() string
	// Entities
	ReadEntities(c interface{}) error
	Stops() chan Stop
	StopTimes() chan StopTime
	Agencies() chan Agency
	Calendars() chan Calendar
	CalendarDates() chan CalendarDate
	FareAttributes() chan FareAttribute
	FareRules() chan FareRule
	FeedInfos() chan FeedInfo
	Frequencies() chan Frequency
	Routes() chan Route
	Shapes() chan Shape
	Transfers() chan Transfer
	Pathways() chan Pathway
	Levels() chan Level
	Trips() chan Trip
	Translations() chan Translation
	Attributions() chan Attribution
}

Reader defines an interface for reading entities from a GTFS feed.

type Route

type Route struct {
	RouteID           string `csv:",required"`
	AgencyID          string
	RouteShortName    string
	RouteLongName     string
	RouteDesc         string
	RouteType         int `csv:",required"`
	RouteURL          string
	RouteColor        string
	RouteTextColor    string
	RouteSortOrder    int
	ContinuousPickup  Int
	ContinuousDropOff Int
	Geometry          Geometry `csv:"-" db:"-"`
	NetworkID         string   `db:"-"`
	AsRoute           int      `db:"-"`
	BaseEntity
}

Route routes.txt

func (*Route) EntityID

func (ent *Route) EntityID() string

EntityID returns ID or RouteID.

func (*Route) EntityKey added in v0.7.1

func (ent *Route) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Route) Errors

func (ent *Route) Errors() (errs []error)

Errors for this Entity.

func (*Route) Filename

func (ent *Route) Filename() string

Filename routes.txt

func (*Route) TableName

func (ent *Route) TableName() string

TableName gtfs_routes

func (*Route) UpdateKeys

func (ent *Route) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type Secret added in v0.10.1

type Secret struct {
	Key                string `json:"key"`
	Username           string `json:"username"`
	Password           string `json:"password"`
	AWSAccessKeyID     string `json:"aws_access_key_id"`
	AWSSecretAccessKey string `json:"aws_secret_access_key"`
	FeedID             string `json:"feed_id"`
	Filename           string `json:"filename"`
}

Secret .

func (Secret) MatchFeed added in v0.10.1

func (s Secret) MatchFeed(feedid string) bool

MatchFeed finds secrets associated with a DMFR FeedID.

func (Secret) MatchFilename added in v0.10.1

func (s Secret) MatchFilename(filename string) bool

MatchFilename finds secrets associated with a DMFR filename.

type Service

type Service struct {
	Calendar
	// contains filtered or unexported fields
}

Service is a Calendar / CalendarDate union.

func NewService

func NewService(c Calendar, cds ...CalendarDate) *Service

NewService returns a new Service.

func NewServicesFromReader

func NewServicesFromReader(reader Reader) []*Service

NewServicesFromReader returns

func (*Service) AddCalendarDate

func (s *Service) AddCalendarDate(cd CalendarDate) error

AddCalendarDate adds a service exception.

func (*Service) CalendarDates added in v0.8.0

func (s *Service) CalendarDates() []CalendarDate

CalendarDates returns CalendarDates for this service.

func (*Service) Exception added in v0.8.0

func (s *Service) Exception(t time.Time) (int, bool)

func (*Service) GetWeekday added in v0.8.0

func (s *Service) GetWeekday(dow int) (int, error)

GetWeekday returns the value fo the day of week.

func (*Service) HasAtLeastOneDay added in v0.8.0

func (s *Service) HasAtLeastOneDay() bool

HasAtLeastOneDay checks if the Service is active for at least one day.

func (*Service) IsActive

func (s *Service) IsActive(t time.Time) bool

IsActive returns if this Service period is active on a specified date.

func (*Service) Reset added in v0.8.8

func (s *Service) Reset()

Reset resets calendars, except ServiceID

func (*Service) ServicePeriod

func (s *Service) ServicePeriod() (time.Time, time.Time)

ServicePeriod returns the widest possible range of days with transit service, including service exceptions.

func (*Service) SetWeekday added in v0.8.0

func (s *Service) SetWeekday(dow int, value int) error

SetWeekday sets the day of week.

func (*Service) Simplify added in v0.8.0

func (s *Service) Simplify() (*Service, error)

Simplify tries to simplify exceptions down to a basic calendar with fewer exceptions.

type Shape

type Shape struct {
	ShapeID           string     `csv:",required"`
	ShapePtLat        float64    `db:"-" csv:",required"`
	ShapePtLon        float64    `db:"-" csv:",required"`
	ShapePtSequence   int        `db:"-" csv:",required"`
	ShapeDistTraveled float64    `db:"-"`
	Geometry          LineString `db:"geometry" csv:"-"`
	Generated         bool       `db:"generated" csv:"-"`
	BaseEntity
}

Shape shapes.txt

func NewShapeFromShapes

func NewShapeFromShapes(shapes []Shape) Shape

NewShapeFromShapes takes Shapes with single points and returns a Shape with linestring geometry. Any errors from the input errors, or errors such as duplicate sequences, are added as entity errors.

func (*Shape) EntityID

func (ent *Shape) EntityID() string

EntityID returns the ID or ShapeID.

func (*Shape) EntityKey added in v0.7.1

func (ent *Shape) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Shape) Errors

func (ent *Shape) Errors() (errs []error)

Errors for this Entity.

func (*Shape) Filename

func (ent *Shape) Filename() string

Filename shapes.txt

func (*Shape) SetString

func (ent *Shape) SetString(key string, value string) error

SetString provides a fast, non-reflect loading path.

func (*Shape) TableName

func (ent *Shape) TableName() string

TableName gtfs_shapes

type Stop

type Stop struct {
	StopID             string `csv:",required" required:"true"`
	StopName           string
	StopCode           string
	StopDesc           string
	StopLat            float64 `db:"-"` // csv load to Geometry
	StopLon            float64 `db:"-"`
	ZoneID             string
	StopURL            string
	TtsStopName        String
	PlatformCode       String
	LocationType       int
	ParentStation      Key
	StopTimezone       string
	WheelchairBoarding int
	LevelID            Key
	Geometry           Point  `csv:"-" db:"geometry"`
	AreaID             string `db:"-"`
	BaseEntity
}

Stop stops.txt

func (*Stop) Coordinates

func (ent *Stop) Coordinates() [2]float64

Coordinates returns the stop lon,lat as a [2]float64

func (*Stop) EntityID

func (ent *Stop) EntityID() string

EntityID returns the ID or StopID.

func (*Stop) EntityKey added in v0.7.1

func (ent *Stop) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Stop) Errors

func (ent *Stop) Errors() (errs []error)

Errors for this Entity.

func (*Stop) Filename

func (ent *Stop) Filename() string

Filename stops.txt

func (*Stop) SetCoordinates

func (ent *Stop) SetCoordinates(p [2]float64)

SetCoordinates takes a [2]float64 and sets the Stop's lon,lat

func (*Stop) TableName

func (ent *Stop) TableName() string

TableName gtfs_stops

func (*Stop) UpdateKeys

func (ent *Stop) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type StopTime

type StopTime struct {
	TripID            string
	StopID            string `csv:",required" required:"true"`
	StopSequence      int    `csv:",required" required:"true"`
	StopHeadsign      String
	ArrivalTime       WideTime
	DepartureTime     WideTime
	PickupType        Int
	DropOffType       Int
	ContinuousPickup  Int
	ContinuousDropOff Int
	ShapeDistTraveled Float
	Timepoint         Int
	Interpolated      Int `csv:"-"` // interpolated times: 0 for provided, 1 interpolated // TODO: 1 for shape, 2 for straight-line
	FeedVersionID     int `csv:"-"`
	// contains filtered or unexported fields
}

StopTime stop_times.txt

func (*StopTime) AddError added in v0.7.1

func (ent *StopTime) AddError(err error)

AddError adds a loading error to the entity, e.g. from a CSV parse failure

func (*StopTime) AddWarning added in v0.7.1

func (ent *StopTime) AddWarning(err error)

AddWarning .

func (*StopTime) EntityID

func (ent *StopTime) EntityID() string

EntityID returns nothing.

func (*StopTime) Errors

func (ent *StopTime) Errors() []error

Errors for this Entity.

func (*StopTime) Extra added in v0.7.1

func (ent *StopTime) Extra() map[string]string

Extra provides any additional fields that were present.

func (*StopTime) Filename

func (ent *StopTime) Filename() string

Filename stop_times.txt

func (*StopTime) GetString

func (ent *StopTime) GetString(key string) (string, error)

GetString returns the string representation of an field.

func (*StopTime) SetExtra added in v0.7.1

func (ent *StopTime) SetExtra(key string, value string)

SetExtra adds a string key, value pair to the entity's extra fields.

func (*StopTime) SetFeedVersionID added in v0.7.1

func (ent *StopTime) SetFeedVersionID(fvid int)

SetFeedVersionID sets the Entity's FeedVersionID.

func (*StopTime) SetString

func (ent *StopTime) SetString(key, value string) error

SetString provides a fast, non-reflect loading path.

func (*StopTime) TableName

func (ent *StopTime) TableName() string

TableName gtfs_stop_times

func (*StopTime) UpdateKeys

func (ent *StopTime) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

func (*StopTime) Warnings added in v0.7.1

func (ent *StopTime) Warnings() []error

Warnings for this Entity.

type String added in v0.10.1

type String struct {
	Valid  bool
	String string
}

func NewOString added in v0.8.0

func NewOString(v string) String

func NewString added in v0.10.1

func NewString(v string) String

func (String) MarshalGQL added in v0.10.1

func (r String) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*String) MarshalJSON added in v0.10.1

func (r *String) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.marshaler interface.

func (*String) Scan added in v0.10.1

func (r *String) Scan(src interface{}) error

Scan implements sql.Scanner

func (*String) UnmarshalGQL added in v0.10.1

func (r *String) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*String) UnmarshalJSON added in v0.10.1

func (r *String) UnmarshalJSON(v []byte) error

UnmarshalJSON implements json.Marshaler interface.

func (String) Value added in v0.10.1

func (r String) Value() (driver.Value, error)

Value returns nil if empty

type Tags added in v0.8.5

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

Tags is a map[string]string with json and gql marshal support. This is a struct instead of bare map[string]string because of a gqlgen issue.

func (*Tags) Get added in v0.8.5

func (r *Tags) Get(k string) (string, bool)

Get a tag value by key

func (*Tags) Keys added in v0.8.7

func (r *Tags) Keys() []string

Keys return the tag keys

func (Tags) MarshalGQL added in v0.8.5

func (r Tags) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Tags) MarshalJSON added in v0.8.5

func (r *Tags) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.marshaler interface.

func (*Tags) Scan added in v0.8.5

func (r *Tags) Scan(value interface{}) error

Scan .

func (*Tags) Set added in v0.8.5

func (r *Tags) Set(k, v string)

Set a tag value

func (*Tags) UnmarshalGQL added in v0.8.5

func (r *Tags) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Tags) UnmarshalJSON added in v0.8.5

func (r *Tags) UnmarshalJSON(v []byte) error

UnmarshalJSON implements json.Marshaler interface.

func (Tags) Value added in v0.8.5

func (r Tags) Value() (driver.Value, error)

Value .

type Time added in v0.10.1

type Time struct {
	Time  time.Time
	Valid bool
}

Time is a nullable date without time component

func NewOTime added in v0.8.4

func NewOTime(v time.Time) Time

func NewTime added in v0.10.1

func NewTime(v time.Time) Time

func (*Time) IsZero added in v0.10.1

func (r *Time) IsZero() bool

IsZero returns if this is a zero value.

func (Time) MarshalGQL added in v0.10.1

func (r Time) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Time) MarshalJSON added in v0.10.1

func (r *Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Time) Scan added in v0.10.1

func (r *Time) Scan(src interface{}) error

Scan implements sql.Scanner

func (*Time) String added in v0.10.1

func (r *Time) String() string

func (*Time) UnmarshalGQL added in v0.10.1

func (r *Time) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (Time) Value added in v0.10.1

func (r Time) Value() (driver.Value, error)

Value returns nil if empty

type Timestamps

type Timestamps struct {
	CreatedAt time.Time `csv:"-"`
	UpdatedAt time.Time `csv:"-"`
}

Timestamps .

func (*Timestamps) UpdateTimestamps

func (ent *Timestamps) UpdateTimestamps()

UpdateTimestamps initializes or updates CreatedAt / UpdatedAt

type Transfer

type Transfer struct {
	FromStopID      string `csv:",required" required:"true"`
	ToStopID        string `csv:",required" required:"true"`
	TransferType    int
	MinTransferTime Int
	BaseEntity
}

Transfer transfers.txt

func (*Transfer) Errors

func (ent *Transfer) Errors() (errs []error)

Errors for this Entity.

func (*Transfer) Filename

func (ent *Transfer) Filename() string

Filename transfers.txt

func (*Transfer) TableName

func (ent *Transfer) TableName() string

TableName gtfs_transfers

func (*Transfer) UpdateKeys

func (ent *Transfer) UpdateKeys(emap *EntityMap) error

UpdateKeys updates entity references.

type Translation added in v0.10.0

type Translation struct {
	// "TableNameValue" because TableName is a required interface method
	TableNameValue String `db:"table_name" csv:"table_name"`
	FieldName      String
	Language       String
	Translation    String
	RecordID       String
	RecordSubID    String
	FieldValue     String
	BaseEntity
}

func (*Translation) Errors added in v0.10.0

func (ent *Translation) Errors() (errs []error)

Errors for this Entity.

func (*Translation) Filename added in v0.10.0

func (ent *Translation) Filename() string

func (*Translation) TableName added in v0.10.0

func (ent *Translation) TableName() string

type Trip

type Trip struct {
	RouteID              string `csv:",required"`
	ServiceID            string `csv:",required"`
	TripID               string `csv:",required"`
	TripHeadsign         string
	TripShortName        string
	DirectionID          int
	BlockID              string
	ShapeID              Key
	WheelchairAccessible int
	BikesAllowed         int
	StopTimes            []StopTime `csv:"-" db:"-"` // for validation methods
	StopPatternID        int        `csv:"-"`
	JourneyPatternID     string     `csv:"-"`
	JourneyPatternOffset int        `csv:"-"`
	BaseEntity
}

Trip trips.txt

func (*Trip) EntityID

func (ent *Trip) EntityID() string

EntityID returns the ID or TripID.

func (*Trip) EntityKey added in v0.7.1

func (ent *Trip) EntityKey() string

EntityKey returns the GTFS identifier.

func (*Trip) Errors

func (ent *Trip) Errors() (errs []error)

Errors for this Entity.

func (*Trip) Filename

func (ent *Trip) Filename() string

Filename trips.txt

func (*Trip) TableName

func (ent *Trip) TableName() string

TableName gtfs_trips

func (*Trip) UpdateKeys

func (ent *Trip) UpdateKeys(emap *EntityMap) error

UpdateKeys updates Entity references.

type WideTime

type WideTime struct {
	Seconds int
	Valid   bool
}

WideTime handles seconds since midnight, allows >24 hours.

func NewWideTime

func NewWideTime(value string) (wt WideTime, err error)

NewWideTime converts the csv string to a WideTime.

func NewWideTimeFromSeconds added in v0.8.0

func NewWideTimeFromSeconds(value int) WideTime

NewWideTimeFromSeconds creates a valid WideTime from Seconds.

func (WideTime) MarshalGQL added in v0.7.2

func (wt WideTime) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*WideTime) Scan

func (wt *WideTime) Scan(src interface{}) error

Scan implements sql.Scanner

func (*WideTime) String

func (wt *WideTime) String() string

func (*WideTime) UnmarshalGQL added in v0.7.2

func (wt *WideTime) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (WideTime) Value

func (wt WideTime) Value() (driver.Value, error)

Value implements driver.Value

type Writer

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

Writer writes a GTFS feed.

Directories

Path Synopsis
Package tests must be in a separate package to avoid circular imports
Package tests must be in a separate package to avoid circular imports

Jump to

Keyboard shortcuts

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