model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Done

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agency

type Agency struct {
	AgencyID       string `csv:"agency_id"`
	AgencyName     string `csv:"agency_name"`
	AgencyURL      string `csv:"agency_url"`
	AgencyTimezone string `csv:"agency_timezone"`
	AgencyLang     string `csv:"agency_lang"`
	AgencyPhone    string `csv:"agency_phone"`
	AgencyFareURL  string `csv:"agency_fare_url"`
	AgencyEmail    string `csv:"agency_email"`
}

func (Agency) TableFileName

func (a Agency) TableFileName() string

type Attribution

type Attribution struct {
	AttributionID    string                 `csv:"attribution_id"`
	AgencyID         string                 `csv:"agency_id"`
	RouteID          string                 `csv:"route_id"`
	TripID           string                 `csv:"trip_id"`
	OrganizationName string                 `csv:"organization_name"`
	IsProducer       AttributionIsProducer  `csv:"is_producer,ParseIsProducer"`
	IsOperator       AttributionIsOperator  `csv:"is_operator,ParseIsOperator"`
	IsAuthority      AttributionIsAuthority `csv:"is_authority,ParseIsAuthority"`
	AttributionURL   string                 `csv:"attribution_url"`
	AttributionEmail string                 `csv:"attribution_email"`
	AttributionPhone string                 `csv:"attribution_phone"`
}

func (*Attribution) ParseIsAuthority

func (a *Attribution) ParseIsAuthority(value string) error

func (*Attribution) ParseIsOperator

func (a *Attribution) ParseIsOperator(value string) error

func (*Attribution) ParseIsProducer

func (a *Attribution) ParseIsProducer(value string) error

func (Attribution) TableFileName

func (a Attribution) TableFileName() string

type AttributionIsAuthority

type AttributionIsAuthority bool
const (
	AttributionIsAuthorityNoRole  AttributionIsAuthority = false
	AttributionIsAuthorityHasRole AttributionIsAuthority = true
)

type AttributionIsOperator

type AttributionIsOperator bool
const (
	AttributionIsOperatorNoRole  AttributionIsOperator = false
	AttributionIsOperatorHasRole AttributionIsOperator = true
)

type AttributionIsProducer

type AttributionIsProducer bool
const (
	AttributionIsProducerNoRole  AttributionIsProducer = false
	AttributionIsProducerHasRole AttributionIsProducer = true
)

type Calendar

type Calendar struct {
	ServiceID string          `csv:"service_id"`
	Monday    CalendarService `csv:"monday,ParseMonday"`
	Tuesday   CalendarService `csv:"tuesday,ParseTuesday"`
	Wednesday CalendarService `csv:"wednesday,ParseWednesday"`
	Thursday  CalendarService `csv:"thursday,ParseThursday"`
	Friday    CalendarService `csv:"friday,ParseFriday"`
	Saturday  CalendarService `csv:"saturday,ParseSaturday"`
	Sunday    CalendarService `csv:"sunday,ParseSunday"`
	StartDate time.Time       `csv:"start_date,ParseStartDate"`
	EndDate   time.Time       `csv:"end_date,ParseEndDate"`
}

func (*Calendar) ParseEndDate

func (c *Calendar) ParseEndDate(value string) (err error)

func (*Calendar) ParseFriday

func (c *Calendar) ParseFriday(value string) (err error)

func (*Calendar) ParseMonday

func (c *Calendar) ParseMonday(value string) (err error)

func (*Calendar) ParseSaturday

func (c *Calendar) ParseSaturday(value string) (err error)

func (*Calendar) ParseStartDate

func (c *Calendar) ParseStartDate(value string) (err error)

func (*Calendar) ParseSunday

func (c *Calendar) ParseSunday(value string) (err error)

func (*Calendar) ParseThursday

func (c *Calendar) ParseThursday(value string) (err error)

func (*Calendar) ParseTuesday

func (c *Calendar) ParseTuesday(value string) (err error)

func (*Calendar) ParseWednesday

func (c *Calendar) ParseWednesday(value string) (err error)

func (Calendar) TableFileName

func (c Calendar) TableFileName() string

type CalendarDate

type CalendarDate struct {
	ServiceID     string                `csv:"service_id"`
	Date          time.Time             `csv:"date,ParseDate"`
	ExceptionType CalendarDateException `csv:"exception_type,ParseExceptionType"`
}

func (*CalendarDate) ParseDate

func (c *CalendarDate) ParseDate(value string) (err error)

func (*CalendarDate) ParseExceptionType

func (c *CalendarDate) ParseExceptionType(value string) error

func (CalendarDate) TableFileName

func (c CalendarDate) TableFileName() string

type CalendarDateException

type CalendarDateException byte
const (
	CalendarDateExceptionAdded   CalendarDateException = 1
	CalendarDateExceptionRemoved CalendarDateException = 2
)

type CalendarService

type CalendarService bool
const (
	CalendarServiceNotAvailable CalendarService = false
	CalendarServiceAvailable    CalendarService = true
)

type FareAttribute

type FareAttribute struct {
	FareID           string                     `csv:"fare_id"`
	Price            float64                    `csv:"price"`
	CurrencyType     string                     `csv:"currency_type"`
	PaymentMethod    FareAttributePaymentMethod `csv:"payment_method,ParsePaymentMethod"`
	Transfers        FareAttributeTransfers     `csv:"transfers,ParseTransfers"`
	AgencyID         string                     `csv:"agency_id"`
	TransferDuration uint                       `csv:"transfer_duration"`
}

func (*FareAttribute) ParsePaymentMethod

func (f *FareAttribute) ParsePaymentMethod(value string) error

func (*FareAttribute) ParseTransfers

func (f *FareAttribute) ParseTransfers(value string) error

func (FareAttribute) TableFileName

func (f FareAttribute) TableFileName() string

type FareAttributePaymentMethod

type FareAttributePaymentMethod byte
const (
	FareAttributePaymentMethodOnBoard     FareAttributePaymentMethod = 0
	FareAttributePaymentMethodBeforeBoard FareAttributePaymentMethod = 1
)

type FareAttributeTransfers

type FareAttributeTransfers int8
const (
	FareAttributeTransfersNoTransfers        FareAttributeTransfers = 0
	FareAttributeTransfersOneTransfer        FareAttributeTransfers = 1
	FareAttributeTransfersTwoTransfers       FareAttributeTransfers = 2
	FareAttributeTransfersUnlimitedTransfers FareAttributeTransfers = -1 // TODO: Maybe convert to `string` type
)

type FareRule

type FareRule struct {
	FareID        string `csv:"fare_id"`
	RouteID       string `csv:"route_id"`
	OriginID      string `csv:"origin_id"`
	DestinationID string `csv:"destination_id"`
	ContainsID    string `csv:"contains_id"`
}

func (FareRule) TableFileName

func (f FareRule) TableFileName() string

type FeedInfo

type FeedInfo struct {
	FeedPublisherName string    `csv:"feed_publisher_name"`
	FeedPublisherURL  string    `csv:"feed_publisher_url"`
	FeedLang          string    `csv:"feed_lang"`
	DefaultLang       string    `csv:"default_lang"`
	FeedStartDate     time.Time `csv:"feed_start_date,ParseFeedStartDate"`
	FeedEndDate       time.Time `csv:"feed_end_date,ParseFeedEndDate"`
	FeedVersion       string    `csv:"feed_version"`
	FeedContactEmail  string    `csv:"feed_contact_email"`
	FeedContactURL    string    `csv:"feed_contact_url"`
}

func (*FeedInfo) ParseFeedEndDate

func (f *FeedInfo) ParseFeedEndDate(value string) (err error)

func (*FeedInfo) ParseFeedStartDate

func (f *FeedInfo) ParseFeedStartDate(value string) (err error)

func (FeedInfo) TableFileName

func (f FeedInfo) TableFileName() string

type Frequency

type Frequency struct {
	TripID      string              `csv:"trip_id"`
	StartTime   GTFSTime            `csv:"start_time,ParseStartTime"`
	EndTime     GTFSTime            `csv:"end_time,ParseEndTime"`
	HeadwaySecs uint                `csv:"headway_secs"`
	ExactTimes  FrequencyExactTimes `csv:"exact_times,ParseExactTimes"`
}

func (*Frequency) ParseEndTime

func (f *Frequency) ParseEndTime(value string) (err error)

func (*Frequency) ParseExactTimes

func (f *Frequency) ParseExactTimes(value string) (err error)

func (*Frequency) ParseStartTime

func (f *Frequency) ParseStartTime(value string) (err error)

func (Frequency) TableFileName

func (f Frequency) TableFileName() string

type FrequencyExactTimes

type FrequencyExactTimes byte
const (
	FrequencyExactTimesFrequencyBased FrequencyExactTimes = 0
	FrequencyExactTimesScheduleBased  FrequencyExactTimes = 1
)

type GTFSTime

type GTFSTime int

GTFSTime is number of seconds from midnight 00:00:53 = 53 09:15:33 = 33333 (9 * 3600 + 15 * 60 + 33)

func NewEmptyGTFSTime

func NewEmptyGTFSTime() GTFSTime

func NewGTFSTime

func NewGTFSTime(value string) (GTFSTime, error)

func (GTFSTime) IsEmpty

func (s GTFSTime) IsEmpty() bool

func (GTFSTime) String

func (s GTFSTime) String() string

type Level

type Level struct {
	LevelID    string  `csv:"level_id"`
	LevelIndex float64 `csv:"level_index"`
	LevelName  string  `csv:"level_name"`
}

func (Level) TableFileName

func (l Level) TableFileName() string

type Modelable

type Modelable interface {
	TableFileName() string
}

type Pathway

type Pathway struct {
	PathwayID            string                 `csv:"pathway_id"`
	FromStopID           string                 `csv:"from_stop_id"`
	ToStopID             string                 `csv:"to_stop_id"`
	PathwayMode          PathwayPathwayMode     `csv:"pathway_mode,ParsePathwayMode"`
	IsBidirectional      PathwayIsBidirectional `csv:"is_bidirectional,ParseIsBidirectional"`
	Length               float64                `csv:"length"`
	TraversalTime        uint                   `csv:"traversal_time"`
	StairCount           uint                   `csv:"stair_count"`
	MaxSlope             float64                `csv:"max_slope"`
	MinWidth             float64                `csv:"min_width"`
	SignpostedAs         string                 `csv:"signposted_as"`
	ReversedSignpostedAs string                 `csv:"reversed_signposted_as"`
}

func (*Pathway) ParseIsBidirectional

func (p *Pathway) ParseIsBidirectional(value string) error

func (*Pathway) ParsePathwayMode

func (p *Pathway) ParsePathwayMode(value string) error

func (Pathway) TableFileName

func (p Pathway) TableFileName() string

type PathwayIsBidirectional

type PathwayIsBidirectional bool
const (
	PathwayIsBidirectionalNo  PathwayIsBidirectional = false
	PathwayIsBidirectionalYes PathwayIsBidirectional = true
)

type PathwayPathwayMode

type PathwayPathwayMode byte
const (
	PathwayPathwayModeWalkway    PathwayPathwayMode = 1
	PathwayPathwayModeStairs     PathwayPathwayMode = 2
	PathwayPathwayModeTravelator PathwayPathwayMode = 3
	PathwayPathwayModeEscalator  PathwayPathwayMode = 4
	PathwayPathwayModeElevator   PathwayPathwayMode = 5
	PathwayPathwayModeFareGate   PathwayPathwayMode = 6
	PathwayPathwayModeExitGate   PathwayPathwayMode = 7
)

type Route

type Route struct {
	RouteID           string                 `csv:"route_id"`
	AgencyID          string                 `csv:"agency_id"`
	RouteShortName    string                 `csv:"route_short_name"`
	RouteLongName     string                 `csv:"route_long_name"`
	RouteDesc         string                 `csv:"route_desc"`
	RouteType         RouteRouteType         `csv:"route_type"`
	RouteURL          string                 `csv:"route_url"`
	RouteColor        string                 `csv:"route_color"`
	RouteTextColor    string                 `csv:"route_text_color"`
	RouteSortOrder    uint                   `csv:"route_sort_order"`
	ContinuousPickup  RouteContinuousPickup  `csv:"continuous_pickup,ParseContinuousPickup"`
	ContinuousDropOff RouteContinuousDropOff `csv:"continuous_drop_off,ParseContinuousDropOff"`
}

func (*Route) ParseContinuousDropOff

func (r *Route) ParseContinuousDropOff(value string) error

func (*Route) ParseContinuousPickup

func (r *Route) ParseContinuousPickup(value string) error

func (Route) TableFileName

func (r Route) TableFileName() string

type RouteContinuousDropOff

type RouteContinuousDropOff byte
const (
	RouteContinuousDropOffContinuous   RouteContinuousDropOff = 0
	RouteContinuousDropOffNoContinuous RouteContinuousDropOff = 1
	RouteContinuousDropOffPhone        RouteContinuousDropOff = 2
	RouteContinuousDropOffDriver       RouteContinuousDropOff = 3
)

type RouteContinuousPickup

type RouteContinuousPickup byte
const (
	RouteContinuousPickupContinuous   RouteContinuousPickup = 0
	RouteContinuousPickupNoContinuous RouteContinuousPickup = 1
	RouteContinuousPickupPhone        RouteContinuousPickup = 2
	RouteContinuousPickupDriver       RouteContinuousPickup = 3
)

type RouteRouteType

type RouteRouteType int

type Shape

type Shape struct {
	ShapeID           string  `csv:"shape_id"`
	ShapePtLat        float64 `csv:"shape_pt_lat"`
	ShapePtLon        float64 `csv:"shape_pt_lon"`
	ShapePtSequence   uint    `csv:"shape_pt_sequence"`
	ShapeDistTraveled float64 `csv:"shape_dist_traveled"`
}

func (Shape) TableFileName

func (s Shape) TableFileName() string

type Stop

type Stop struct {
	StopID             string                 `csv:"stop_id"`
	StopCode           string                 `csv:"stop_code"`
	StopName           string                 `csv:"stop_name"`
	StopDesc           string                 `csv:"stop_desc"`
	StopLat            float64                `csv:"stop_lat"`
	StopLon            float64                `csv:"stop_lon"`
	ZoneID             string                 `csv:"zone_id"`
	StopURL            string                 `csv:"stop_url"`
	LocationType       StopLocationType       `csv:"location_type,ParseLocationType"`
	ParentStation      string                 `csv:"parent_station"`
	StopTimezone       string                 `csv:"stop_timezone"`
	WheelchairBoarding StopWheelchairBoarding `csv:"wheelchair_boarding,ParseWheelchairBoarding"`
	LevelID            string                 `csv:"level_id"`
	PlatformCode       string                 `csv:"platform_code"`
}

func (*Stop) ParseLocationType

func (s *Stop) ParseLocationType(value string) error

func (*Stop) ParseWheelchairBoarding

func (s *Stop) ParseWheelchairBoarding(value string) error

func (Stop) TableFileName

func (s Stop) TableFileName() string

type StopLocationType

type StopLocationType byte
const (
	StopLocationTypeStopOrPlatform StopLocationType = 0
	StopLocationTypeStation        StopLocationType = 1
	StopLocationTypeEntranceExit   StopLocationType = 2
	StopLocationTypeGenericNone    StopLocationType = 3
	StopLocationTypeBoardingArea   StopLocationType = 4
)

type StopTime

type StopTime struct {
	TripID            string                    `csv:"trip_id"`
	ArrivalTime       GTFSTime                  `csv:"arrival_time,ParseArrivalTime"`
	DepartureTime     GTFSTime                  `csv:"departure_time,ParseDepartureTime"`
	StopID            string                    `csv:"stop_id"`
	StopSequence      uint                      `csv:"stop_sequence"`
	StopHeadsign      string                    `csv:"stop_headsign"`
	PickupType        StopTimePickupType        `csv:"pickup_type,ParsePickupType"`
	DropOffType       StopTimeDropOffType       `csv:"drop_off_type,ParseDropOffType"`
	ContinuousPickup  StopTimeContinuousPickup  `csv:"continuous_pickup,ParseContinuousPickup"`
	ContinuousDropOff StopTimeContinuousDropOff `csv:"continuous_drop_off,ParseContinuousDropOff"`
	ShapeDistTraveled float64                   `csv:"shape_dist_traveled,ParseShapeDistTraveled"`
	Timepoint         StopTimeTimepoint         `csv:"timepoint,ParseTimepoint"`
}

func (*StopTime) ParseArrivalTime

func (s *StopTime) ParseArrivalTime(value string) (err error)

func (*StopTime) ParseContinuousDropOff

func (s *StopTime) ParseContinuousDropOff(value string) (err error)

func (*StopTime) ParseContinuousPickup

func (s *StopTime) ParseContinuousPickup(value string) (err error)

func (*StopTime) ParseDepartureTime

func (s *StopTime) ParseDepartureTime(value string) (err error)

func (*StopTime) ParseDropOffType

func (s *StopTime) ParseDropOffType(value string) (err error)

func (*StopTime) ParsePickupType

func (s *StopTime) ParsePickupType(value string) (err error)

func (*StopTime) ParseShapeDistTraveled added in v0.1.1

func (s *StopTime) ParseShapeDistTraveled(value string) (err error)

func (*StopTime) ParseTimepoint

func (s *StopTime) ParseTimepoint(value string) (err error)

func (StopTime) TableFileName

func (s StopTime) TableFileName() string

type StopTimeContinuousDropOff

type StopTimeContinuousDropOff byte
const (
	StopTimeContinuousDropOffContinuous   StopTimeContinuousDropOff = 0
	StopTimeContinuousDropOffNoContinuous StopTimeContinuousDropOff = 1
	StopTimeContinuousDropOffPhone        StopTimeContinuousDropOff = 2
	StopTimeContinuousDropOffDriver       StopTimeContinuousDropOff = 3
)

type StopTimeContinuousPickup

type StopTimeContinuousPickup byte
const (
	StopTimeContinuousPickupContinuous   StopTimeContinuousPickup = 0
	StopTimeContinuousPickupNoContinuous StopTimeContinuousPickup = 1
	StopTimeContinuousPickupPhone        StopTimeContinuousPickup = 2
	StopTimeContinuousPickupDriver       StopTimeContinuousPickup = 3
)

type StopTimeDropOffType

type StopTimeDropOffType byte
const (
	StopTimeDropOffTypeScheduled StopTimeDropOffType = 0
	StopTimeDropOffTypeNoDropOff StopTimeDropOffType = 1
	StopTimeDropOffTypeMustPhone StopTimeDropOffType = 2
	StopTimeDropOffTypeDriver    StopTimeDropOffType = 3
)

type StopTimePickupType

type StopTimePickupType byte
const (
	StopTimePickupTypeScheduled StopTimePickupType = 0
	StopTimePickupTypeNoPickup  StopTimePickupType = 1
	StopTimePickupTypeMustPhone StopTimePickupType = 2
	StopTimePickupTypeDriver    StopTimePickupType = 3
)

type StopTimeTimepoint

type StopTimeTimepoint byte
const (
	StopTimeTimepointApproximate StopTimeTimepoint = 0
	StopTimeTimepointExact       StopTimeTimepoint = 1
)

type StopWheelchairBoarding

type StopWheelchairBoarding byte
const (
	StopWheelchairBoardingInherit    StopWheelchairBoarding = 0
	StopWheelchairBoardingAllowed    StopWheelchairBoarding = 1
	StopWheelchairBoardingNotAllowed StopWheelchairBoarding = 2
)

type Transfer

type Transfer struct {
	FromStopID      string               `csv:"from_stop_id"`
	ToStopID        string               `csv:"to_stop_id"`
	TransferType    TransferTransferType `csv:"transfer_type,ParseTransferType"`
	MinTransferTime uint                 `csv:"min_transfer_time"`
	FromRouteID     string               `csv:"from_route_id"`
	ToRouteID       string               `csv:"to_route_id"`
	FromTripID      string               `csv:"from_trip_id"`
	ToTripID        string               `csv:"to_trip_id"`
}

func (*Transfer) ParseTransferType

func (t *Transfer) ParseTransferType(value string) (err error)

func (Transfer) TableFileName

func (t Transfer) TableFileName() string

type TransferTransferType

type TransferTransferType byte
const (
	TransferTransferTypeRecommended     TransferTransferType = 0
	TransferTransferTypeTimed           TransferTransferType = 1
	TransferTransferTypeRequiredMinimum TransferTransferType = 2
	TransferTransferTypeNotPossible     TransferTransferType = 3
)

type Translation

type Translation struct {
	TableName   string `csv:"table_name"`
	FieldName   string `csv:"field_name"`
	Language    string `csv:"language"`
	Translation string `csv:"translation"`
	RecordID    string `csv:"record_id"`
	RecordSubID string `csv:"record_sub_id"`
	FieldValue  string `csv:"field_value"`
}

func (Translation) TableFileName

func (t Translation) TableFileName() string

type Trip

type Trip struct {
	RouteID              string                   `csv:"route_id"`
	ServiceID            string                   `csv:"service_id"`
	TripID               string                   `csv:"trip_id"`
	TripHeadsign         string                   `csv:"trip_headsign"`
	TripShortName        string                   `csv:"trip_short_name"`
	DirectionID          TripDirectionID          `csv:"direction_id,ParseDirectionID"`
	BlockID              string                   `csv:"block_id"`
	ShapeID              string                   `csv:"shape_id"`
	WheelchairAccessible TripWheelchairAccessible `csv:"wheelchair_accessible,ParseWheelchairAccessible"`
	BikesAllowed         TripBikesAllowed         `csv:"bikes_allowed,ParseBikesAllowed"`
}

func (*Trip) ParseBikesAllowed

func (t *Trip) ParseBikesAllowed(value string) error

func (*Trip) ParseDirectionID

func (t *Trip) ParseDirectionID(value string) error

func (*Trip) ParseWheelchairAccessible

func (t *Trip) ParseWheelchairAccessible(value string) error

func (Trip) TableFileName

func (t Trip) TableFileName() string

type TripBikesAllowed

type TripBikesAllowed byte
const (
	TripBikesAllowedNoInformation TripBikesAllowed = 0
	TripBikesAllowedYes           TripBikesAllowed = 1
	TripBikesAllowedNo            TripBikesAllowed = 2
)

type TripDirectionID

type TripDirectionID byte
const (
	TripDirectionIDOutbound TripDirectionID = 0
	TripDirectionIDInbound  TripDirectionID = 1
)

type TripWheelchairAccessible

type TripWheelchairAccessible byte
const (
	TripWheelchairAccessibleNoInformation TripWheelchairAccessible = 0
	TripWheelchairAccessibleYes           TripWheelchairAccessible = 1
	TripWheelchairAccessibleNo            TripWheelchairAccessible = 2
)

Jump to

Keyboard shortcuts

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