models

package
v0.0.0-...-45692f4 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCsvAsIntArrays

func ParseCsvAsIntArrays(b []byte) ([]int, error)

func ParseCsvAsStringArrays

func ParseCsvAsStringArrays(b []byte) (*[][]string, error)

Types

type Agencies

type Agencies []Agency

func (*Agencies) ToJSONAgencies

func (as *Agencies) ToJSONAgencies() *JSONAgencies

type Agency

type Agency struct {
	Key      string `gorm:"column:agency_key"`
	Id       int    `gorm:"column:agency_id"`
	Name     string `gorm:"column:agency_name"`
	Url      string `gorm:"column:agency_url"`
	Timezone string `gorm:"column:agency_timezone"`
	Lang     string `gorm:"column:agency_lang"`
}

func (*Agency) ToJSONAgency

func (a *Agency) ToJSONAgency() *JSONAgency

type AgencyImportRow

type AgencyImportRow struct {
	Key      string
	Id       int
	Name     string
	Url      string
	Timezone string
	Lang     string
}

type Calendar

type Calendar struct {
	ServiceId int       `gorm:"column:service_id"`
	Monday    bool      `gorm:"column:monday"`
	Tuesday   bool      `gorm:"column:tuesday"`
	Wednesday bool      `gorm:"column:wednesday"`
	Thursday  bool      `gorm:"column:thursday"`
	Friday    bool      `gorm:"column:friday"`
	Saturday  bool      `gorm:"column:saturday"`
	Sunday    bool      `gorm:"column:sunday"`
	StartDate time.Time `gorm:"column:start_date"`
	EndDate   time.Time `gorm:"column:end_date"`
}

func (*Calendar) ToJSONCalendar

func (c *Calendar) ToJSONCalendar() *JSONCalendar

type CalendarDate

type CalendarDate struct {
	ServiceId     int       `gorm:"column:service_id"`
	Date          time.Time `gorm:"column:date"`
	ExceptionType int       `gorm:"column:exception_type"`
}

func (*CalendarDate) ToJSONCalendarDate

func (c *CalendarDate) ToJSONCalendarDate() *JSONCalendarDate

type CalendarDateImportRow

type CalendarDateImportRow struct {
	ServiceId     int
	Date          string
	ExceptionType int
}

type CalendarDates

type CalendarDates []CalendarDate

func (*CalendarDates) ToJSONCalendarDates

func (cs *CalendarDates) ToJSONCalendarDates() *JSONCalendarDates

type CalendarImportRow

type CalendarImportRow struct {
	ServiceId int
	Monday    int
	Tuesday   int
	Wednesday int
	Thursday  int
	Friday    int
	Saturday  int
	Sunday    int
	StartDate string
	EndDate   string
}

type Calendars

type Calendars []Calendar

func (*Calendars) ToJSONCalendars

func (cs *Calendars) ToJSONCalendars() *JSONCalendars

type GTFSFile

type GTFSFile struct {
	Filename string
}

func (GTFSFile) LinesIterator

func (gf GTFSFile) LinesIterator(maxLength int) <-chan []byte

type JSONAgencies

type JSONAgencies []JSONAgency

type JSONAgency

type JSONAgency struct {
	Key      string `json:"key"`
	Id       int    `json:"agencyId"`
	Name     string `json:"name"`
	Url      string `json:"url"`
	Timezone string `json:"timezone"`
	Lang     string `json:"lang"`
}

type JSONCalendar

type JSONCalendar struct {
	ServiceId int      `json:"serviceId"`
	Monday    bool     `json:"monday"`
	Tuesday   bool     `json:"tuesday"`
	Wednesday bool     `json:"wednesday"`
	Thursday  bool     `json:"thursday"`
	Friday    bool     `json:"friday"`
	Saturday  bool     `json:"saturday"`
	Sunday    bool     `json:"sunday"`
	StartDate JSONDate `json:"startDate"`
	EndDate   JSONDate `json:"endDate"`
}

type JSONCalendarDate

type JSONCalendarDate struct {
	ServiceId     int      `json:"serviceId"`
	Date          JSONDate `json:"date"`
	ExceptionType int      `json:"exceptionType"`
}

type JSONCalendarDates

type JSONCalendarDates []JSONCalendarDate

type JSONCalendars

type JSONCalendars []JSONCalendar

type JSONDate

type JSONDate time.Time

func (JSONDate) MarshalJSON

func (t JSONDate) MarshalJSON() ([]byte, error)

type JSONRoute

type JSONRoute struct {
	RouteId        int    `json:"routeId"`
	AgencyId       int    `json:"agencyId"`
	RouteShortName string `json:"routeShortName"`
	RouteLongName  string `json:"routeLongName"`
	RouteDesc      string `json:"routeDesc"`
	RouteType      int    `json:"routeType"`
	RouteUrl       string `json:"routeUrl"`
	RouteColor     string `json:"routeColor"`
	RouteTextColor string `json:"routeTextColor"`
}

type JSONRoutes

type JSONRoutes []JSONRoute

type JSONStop

type JSONStop struct {
	StopId        int    `json:"stopId"`
	StopName      string `json:"stopName"`
	StopDesc      string `json:"stopDesc"`
	StopLat       int    `json:"stopLat"`
	StopLon       int    `json:"stopLon"`
	ZoneId        string `json:"zoneId"`
	StopUrl       string `json:"stopUrl"`
	LocationType  int    `json:"locationType"`
	ParentStation int    `json:"parentStation"`
}

type JSONStopTime

type JSONStopTime struct {
	TripId        int    `json:"tripId"`
	ArrivalTime   string `json:"arrivalTime"`
	DepartureTime string `json:"departureTime"`
	StopId        int    `json:"stopId"`
	StopSequence  int    `json:"stopSequence"`
	StopHeadSign  string `json:"stopHeadSign"`
	PickupType    int    `json:"pickupType"`
	DropOffType   int    `json:"dropOffType"`
}

type JSONStopTimes

type JSONStopTimes []JSONStopTime

type JSONStops

type JSONStops []JSONStop

type JSONTime

type JSONTime time.Time

func (JSONTime) MarshalJSON

func (t JSONTime) MarshalJSON() ([]byte, error)

type JSONTransfer

type JSONTransfer struct {
	FromStopId      int `json:"fromStopId"`
	ToStopId        int `json:"toStopId"`
	TransferType    int `json:"transferType"`
	MinTransferTime int `json:"minTransferTime"`
}

type JSONTransfers

type JSONTransfers []JSONTransfer

type JSONTrip

type JSONTrip struct {
	RouteId      int    `json:"routeId"`
	ServiceId    int    `json:"serviceId"`
	TripId       int    `json:"tripId"`
	TripHeadsign string `json:"tripHeadsign"`
	DirectionId  int    `json:"directionId"`
	BlockId      string `json:"blockId"`
	ShapeId      string `json:"shapeId"`
}

type JSONTrips

type JSONTrips []JSONTrip

type Records

type Records [][]string

func ParseCsv

func ParseCsv(b []byte) (*Records, error)

type Route

type Route struct {
	RouteId        int    `gorm:"column:route_id"`
	AgencyId       int    `gorm:"column:agency_id"`
	RouteShortName string `gorm:"column:route_short_name"`
	RouteLongName  string `gorm:"column:route_long_name"`
	RouteDesc      string `gorm:"column:route_desc"`
	RouteType      int    `gorm:"column:route_type"`
	RouteUrl       string `gorm:"column:route_url"`
	RouteColor     string `gorm:"column:route_color"`
	RouteTextColor string `gorm:"column:route_text_color"`
}

func (*Route) ToJSONRoute

func (r *Route) ToJSONRoute() *JSONRoute

type RouteImportRow

type RouteImportRow struct {
	RouteId        int
	AgencyId       int
	RouteShortName string
	RouteLongName  string
	RouteDesc      string
	RouteType      int
	RouteUrl       string
	RouteColor     string
	RouteTextColor string
}

type Routes

type Routes []Route

func (*Routes) ToJSONRoutes

func (rs *Routes) ToJSONRoutes() *JSONRoutes

type Stop

type Stop struct {
	StopId        int    `gorm:"stop_id"`
	StopName      string `gorm:"stop_name"`
	StopDesc      string `gorm:"stop_desc"`
	StopLat       int    `gorm:"stop_lat"`
	StopLon       int    `gorm:"stop_lon"`
	ZoneId        string `gorm:"zone_id"`
	StopUrl       string `gorm:"stop_url"`
	LocationType  int    `gorm:"location_type"`
	ParentStation int    `gorm:"parent_station"`
}

func (*Stop) ToJSONStop

func (s *Stop) ToJSONStop() *JSONStop

type StopImportRow

type StopImportRow struct {
	StopId        int
	StopCode      string
	StopName      string
	StopDesc      string
	StopLat       float64
	StopLon       float64
	ZoneId        string
	StopUrl       string
	LocationType  int
	ParentStation int
}

type StopTime

type StopTime struct {
	TripId        int    `gorm:"column:trip_id"`
	ArrivalTime   string `gorm:"column:arrival_time"`
	DepartureTime string `gorm:"column:departure_time"`
	StopId        int    `gorm:"column:stop_id"`
	StopSequence  int    `gorm:"column:stop_sequence"`
	StopHeadSign  string `gorm:"column:stop_head_sign"`
	PickupType    int    `gorm:"column:pickup_time"`
	DropOffType   int    `gorm:"column:drop_off_type"`
}

func (*StopTime) ToJSONStopTime

func (st *StopTime) ToJSONStopTime() *JSONStopTime

type StopTimeImportRow

type StopTimeImportRow struct {
	TripId        int
	ArrivalTime   string
	DepartureTime string
	StopId        int
	StopSequence  int
	StopHeadSign  string
	PickupType    int
	DropOffType   int
}

type StopTimes

type StopTimes []StopTime

func (*StopTimes) ToJSONStopTimes

func (sts *StopTimes) ToJSONStopTimes() *JSONStopTimes

type Stops

type Stops []Stop

func (*Stops) ToJSONStops

func (ss *Stops) ToJSONStops() *JSONStops

type Transfer

type Transfer struct {
	Id              int `gorm:"column:id"`
	FromStopId      int `gorm:"column:from_stop_id"`
	ToStopId        int `gorm:"column:to_stop_id"`
	TransferType    int `gorm:"column:transfer_type"`
	MinTransferTime int `gorm:"column:min_transfer_time"`
}

func (*Transfer) ToJSONTransfer

func (t *Transfer) ToJSONTransfer() *JSONTransfer

type TransferImportRow

type TransferImportRow struct {
	FromStopId      int
	ToStopId        int
	TransferType    int
	MinTransferTime int
}

type Transfers

type Transfers []Transfer

func (*Transfers) ToJSONTransfers

func (ts *Transfers) ToJSONTransfers() *JSONTransfers

type Trip

type Trip struct {
	RouteId      int    `bson:"route_id" json:"routeId" gorm:"column:route_id"`
	ServiceId    int    `bson:"service_id" json:"serviceId" gorm:"column:service_id"`
	TripId       int    `bson:"trip_id" json:"tripId" gorm:"column:trip_id"`
	TripHeadsign string `bson:"trip_headsign" json:"tripHeadsign" gorm:"column:trip_headsign"`
	DirectionId  int    `bson:"direction_id" json:"directionId" gorm:"column:direction_id"`
	BlockId      string `bson:"block_id" json:"blockId" gorm:"column:block_id"`
	ShapeId      string `bson:"shape_id" json:"shapeId" gorm:"column:shape_id"`
}

func (*Trip) ToJSONTrip

func (t *Trip) ToJSONTrip() *JSONTrip

type TripImportRow

type TripImportRow struct {
	RouteId      int
	ServiceId    int
	TripId       int
	TripHeadsign string
	DirectionId  int
	BlockId      string
	ShapeId      string
}

type Trips

type Trips []Trip

func (*Trips) ToJSONTrips

func (ts *Trips) ToJSONTrips() *JSONTrips

Jump to

Keyboard shortcuts

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