model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllRole = []Role{
	RoleAnon,
	RoleAdmin,
	RoleUser,
}
View Source
var DB canBeginx

TODO: replace with middleware or configuration

Functions

func MustOpenDB

func MustOpenDB(url string) canBeginx

func Sqrl

func Tx

func Tx(cb func(sqlx.Ext) error) error

Types

type Agency

type Agency struct {
	OnestopID       string `json:"onestop_id"`
	FeedOnestopID   string `json:"feed_onestop_id"`
	FeedVersionSHA1 string `json:"feed_version_sha1"`
	SearchRank      *string
	Geometry        *tl.Polygon `json:"geometry"`
	tl.Agency
}

type AgencyFilter

type AgencyFilter struct {
	OnestopID       *string      `json:"onestop_id"`
	FeedVersionSha1 *string      `json:"feed_version_sha1"`
	FeedOnestopID   *string      `json:"feed_onestop_id"`
	AgencyID        *string      `json:"agency_id"`
	AgencyName      *string      `json:"agency_name"`
	Within          *tl.Polygon  `json:"within"`
	Near            *PointRadius `json:"near"`
	Search          *string      `json:"search"`
}

type AgencyParam

type AgencyParam struct {
	FeedVersionID int
	Limit         *int
	Where         *AgencyFilter
}

type AgencyPlace

type AgencyPlace struct {
	AgencyID int      `json:"agency_id"`
	Name     *string  `json:"name"`
	Adm0name *string  `json:"adm0name"`
	Adm1name *string  `json:"adm1name"`
	Rank     *float64 `json:"rank"`
}

type AgencyPlaceFilter

type AgencyPlaceFilter struct {
	MinRank *float64 `json:"min_rank"`
	Search  *string  `json:"search"`
}

type AgencyPlaceParam

type AgencyPlaceParam struct {
	AgencyID int
	Limit    *int
	Where    *AgencyPlaceFilter
}

type Calendar

type Calendar struct {
	tl.Calendar
}

type CalendarDate

type CalendarDate struct {
	tl.CalendarDate
}

type CalendarDateFilter

type CalendarDateFilter struct {
	Date          *tl.ODate `json:"date"`
	ExceptionType *int      `json:"exception_type"`
}

type CalendarDateParam

type CalendarDateParam struct {
	ServiceID int
	Limit     *int
	Where     *CalendarDateFilter
}

type CensusGeography

type CensusGeography struct {
	ID            int         `json:"id"`
	LayerName     string      `json:"layer_name"`
	Geoid         *string     `json:"geoid"`
	Name          *string     `json:"name"`
	Aland         *float64    `json:"aland"`
	Awater        *float64    `json:"awater"`
	Geometry      *tl.Polygon `json:"geometry"`
	MatchEntityID int         // for matching to a stop, route, agency in query
}

type CensusGeographyParam

type CensusGeographyParam struct {
	Radius     *float64
	LayerName  string
	EntityType string
	EntityID   int
	Limit      *int
}

type CensusTable

type CensusTable struct {
	ID         int
	TableName  string
	TableTitle string
	TableGroup string
}

type CensusTableParam

type CensusTableParam struct {
	Limit *int
}

type CensusValue

type CensusValue struct {
	GeographyID int
	TableID     int
	TableValues ValueMap
}

type CensusValueParam

type CensusValueParam struct {
	GeographyID int
	TableNames  string // these have to be comma joined for now, []string cant be used as map key
	Limit       *int
}

type Feed

type Feed struct {
	SearchRank *string
	tl.Feed
}

func (*Feed) OnestopID

func (f *Feed) OnestopID() (string, error)

OnestopID is called FeedID in transitland-lib.

type FeedAuthorization

type FeedAuthorization struct {
	tl.FeedAuthorization
}

type FeedFilter

type FeedFilter struct {
	OnestopID    *string       `json:"onestop_id"`
	Spec         []string      `json:"spec"`
	FetchError   *bool         `json:"fetch_error"`
	ImportStatus *ImportStatus `json:"import_status"`
	Search       *string       `json:"search"`
}

type FeedInfo

type FeedInfo struct {
	tl.FeedInfo
}

type FeedInfoParam

type FeedInfoParam struct {
	FeedVersionID int
	Limit         *int
}

type FeedLicense

type FeedLicense struct {
	tl.FeedLicense
}

type FeedState

type FeedState struct {
	dmfr.FeedState
}

type FeedUrls

type FeedUrls struct {
	tl.FeedUrls
}

type FeedVersion

type FeedVersion struct {
	tl.FeedVersion
}

type FeedVersionDeleteResult

type FeedVersionDeleteResult struct {
	Success bool `json:"success"`
}

type FeedVersionFetchResult

type FeedVersionFetchResult struct {
	FeedVersion  *FeedVersion
	FetchError   *string
	FoundSHA1    bool
	FoundDirSHA1 bool
}

type FeedVersionFileInfo

type FeedVersionFileInfo struct {
	dmfr.FeedVersionFileInfo
}

type FeedVersionFileInfoParam

type FeedVersionFileInfoParam struct {
	FeedVersionID int
	Limit         *int
}

type FeedVersionFilter

type FeedVersionFilter struct {
	FeedOnestopID *string `json:"feed_onestop_id"`
	Sha1          *string `json:"sha1"`
}

type FeedVersionGtfsImport

type FeedVersionGtfsImport struct {
	WarningCount             *json.RawMessage `json:"warning_count"`
	EntityCount              *json.RawMessage `json:"entity_count"`
	SkipEntityErrorCount     *json.RawMessage `json:"skip_entity_error_count"`
	SkipEntityReferenceCount *json.RawMessage `json:"skip_entity_reference_count"`
	SkipEntityFilterCount    *json.RawMessage `json:"skip_entity_filter_count"`
	SkipEntityMarkedCount    *json.RawMessage `json:"skip_entity_marked_count"`
	dmfr.FeedVersionImport
}

type FeedVersionImportResult

type FeedVersionImportResult struct {
	Success bool
}

type FeedVersionParam

type FeedVersionParam struct {
	FeedID int
	Limit  *int
	Where  *FeedVersionFilter
}

type FeedVersionServiceLevel

type FeedVersionServiceLevel struct {
	dmfr.FeedVersionServiceLevel
}

type FeedVersionServiceLevelFilter

type FeedVersionServiceLevelFilter struct {
	StartDate  *tl.ODate `json:"start_date"`
	EndDate    *tl.ODate `json:"end_date"`
	AllRoutes  *bool     `json:"all_routes"`
	DistinctOn *string   `json:"distinct_on"`
	RouteIds   []string  `json:"route_ids"`
}

type FeedVersionServiceLevelParam

type FeedVersionServiceLevelParam struct {
	FeedVersionID int
	Limit         *int
	Where         *FeedVersionServiceLevelFilter
}

type FeedVersionSetInput

type FeedVersionSetInput struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

type FeedVersionUnimportResult

type FeedVersionUnimportResult struct {
	Success bool `json:"success"`
}

type Frequency

type Frequency struct {
	tl.Frequency
}

type FrequencyParam

type FrequencyParam struct {
	TripID int
	Limit  *int
}

type ImportStatus

type ImportStatus string
const (
	ImportStatusSuccess    ImportStatus = "success"
	ImportStatusError      ImportStatus = "error"
	ImportStatusInProgress ImportStatus = "in_progress"
)

func (ImportStatus) IsValid

func (e ImportStatus) IsValid() bool

func (ImportStatus) MarshalGQL

func (e ImportStatus) MarshalGQL(w io.Writer)

func (ImportStatus) String

func (e ImportStatus) String() string

func (*ImportStatus) UnmarshalGQL

func (e *ImportStatus) UnmarshalGQL(v interface{}) error

type Level

type Level struct {
	tl.Level
}

type Operator

type Operator struct {
	ID                      int
	AgencyID                *int             `json:"agency_id"`
	AgencyName              *string          `json:"agency_name"`
	AgencyOnestopID         *string          `json:"agency_onestop_id"`
	FeedID                  *int             `json:"feed_id"`
	FeedVersionID           *int             `json:"feed_version_id"`
	FeedVersionSha1         *string          `json:"feed_version_sha1"`
	FeedOnestopID           *string          `json:"feed_onestop_id"`
	FeedNamespaceID         *string          `json:"feed_namespace_id"`
	CityName                *string          `json:"city_name"`
	Adm1name                *string          `json:"adm1name"`
	Adm0name                *string          `json:"adm0name"`
	OnestopID               *string          `json:"onestop_id"`
	OperatorID              *int             `json:"operator_id"`
	OperatorOnestopID       *string          `json:"operator_onestop_id"`
	OperatorName            *string          `json:"operator_name"`
	OperatorShortName       *string          `json:"operator_short_name"`
	OperatorTags            *json.RawMessage `json:"operator_tags"` // json map[string]string
	OperatorAssociatedFeeds *json.RawMessage `json:"operator_associated_feeds"`
	PlacesCache             *pq.StringArray  `json:"places_cache"`
	SearchRank              *string
}

type OperatorFilter

type OperatorFilter struct {
	Merged          *bool   `json:"merged"`
	OnestopID       *string `json:"onestop_id"`
	FeedVersionSha1 *string `json:"feed_version_sha1"`
	FeedOnestopID   *string `json:"feed_onestop_id"`
	AgencyID        *string `json:"agency_id"`
	Search          *string `json:"search"`
}

type OperatorParam

type OperatorParam struct {
	FeedID int
	Limit  *int
	Where  *OperatorFilter
}

type Pathway

type Pathway struct {
	tl.Pathway
}

type PathwayFilter

type PathwayFilter struct {
	PathwayMode *int `json:"pathway_mode"`
}

type PathwayParam

type PathwayParam struct {
	FeedVersionID int
	FromStopID    int
	ToStopID      int
	Limit         *int
	Where         *PathwayFilter
}

type PointRadius

type PointRadius struct {
	Lat    float64 `json:"lat"`
	Lon    float64 `json:"lon"`
	Radius float64 `json:"radius"`
}

type Role

type Role string
const (
	RoleAnon  Role = "ANON"
	RoleAdmin Role = "ADMIN"
	RoleUser  Role = "USER"
)

func (Role) IsValid

func (e Role) IsValid() bool

func (Role) MarshalGQL

func (e Role) MarshalGQL(w io.Writer)

func (Role) String

func (e Role) String() string

func (*Role) UnmarshalGQL

func (e *Role) UnmarshalGQL(v interface{}) error

type Route

type Route struct {
	FeedOnestopID                string
	FeedVersionSHA1              string
	OnestopID                    *string
	HeadwaySecondsWeekdayMorning *int
	SearchRank                   *string
	Geometry                     tl.Geometry // is not read from database by default
	tl.Route
}

type RouteFilter

type RouteFilter struct {
	OnestopID         *string      `json:"onestop_id"`
	FeedVersionSha1   *string      `json:"feed_version_sha1"`
	FeedOnestopID     *string      `json:"feed_onestop_id"`
	RouteID           *string      `json:"route_id"`
	RouteType         *int         `json:"route_type"`
	OperatorOnestopID *string      `json:"operator_onestop_id"`
	Within            *tl.Polygon  `json:"within"`
	Near              *PointRadius `json:"near"`
	Search            *string      `json:"search"`
	AgencyIds         []int        `json:"agency_ids"`
}

type RouteGeometry

type RouteGeometry struct {
	RouteID     int           `json:"route_id"`
	DirectionID int           `json:"direction_id"`
	Generated   bool          `json:"generated"`
	Geometry    tl.LineString `json:"geometry"`
}

type RouteGeometryParam

type RouteGeometryParam struct {
	RouteID int
	Limit   *int
}

type RouteHeadway

type RouteHeadway struct {
	ID                           int      `json:"id"`
	RouteID                      int      `json:"route_id"`
	SelectedStopID               int      `json:"selected_stop_id"`
	DirectionID                  int      `json:"direction_id"`
	HeadwaySecs                  *int     `json:"headway_secs"`
	DowCategory                  *int     `json:"dow_category"`
	ServiceDate                  tl.ODate `json:"service_date"`
	ServiceSeconds               *int     `json:"service_seconds"`
	StopTripCount                *int     `json:"stop_trip_count"`
	HeadwaySecondsMorningCount   *int     `json:"headway_seconds_morning_count"`
	HeadwaySecondsMorningMin     *int     `json:"headway_seconds_morning_min"`
	HeadwaySecondsMorningMid     *int     `json:"headway_seconds_morning_mid"`
	HeadwaySecondsMorningMax     *int     `json:"headway_seconds_morning_max"`
	HeadwaySecondsMiddayCount    *int     `json:"headway_seconds_midday_count"`
	HeadwaySecondsMiddayMin      *int     `json:"headway_seconds_midday_min"`
	HeadwaySecondsMiddayMid      *int     `json:"headway_seconds_midday_mid"`
	HeadwaySecondsMiddayMax      *int     `json:"headway_seconds_midday_max"`
	HeadwaySecondsAfternoonCount *int     `json:"headway_seconds_afternoon_count"`
	HeadwaySecondsAfternoonMin   *int     `json:"headway_seconds_afternoon_min"`
	HeadwaySecondsAfternoonMid   *int     `json:"headway_seconds_afternoon_mid"`
	HeadwaySecondsAfternoonMax   *int     `json:"headway_seconds_afternoon_max"`
	HeadwaySecondsNightCount     *int     `json:"headway_seconds_night_count"`
	HeadwaySecondsNightMin       *int     `json:"headway_seconds_night_min"`
	HeadwaySecondsNightMid       *int     `json:"headway_seconds_night_mid"`
	HeadwaySecondsNightMax       *int     `json:"headway_seconds_night_max"`
}

type RouteHeadwayParam

type RouteHeadwayParam struct {
	RouteID int
	Limit   *int
}

type RouteParam

type RouteParam struct {
	AgencyID      int
	FeedVersionID int
	Limit         *int
	Where         *RouteFilter
}

type RouteStop

type RouteStop struct {
	ID       int `json:"id"`
	RouteID  int
	StopID   int
	AgencyID int
}

type RouteStopBuffer

type RouteStopBuffer struct {
	StopPoints     *tl.Geometry `json:"stop_points"`
	StopBuffer     *tl.Geometry `json:"stop_buffer"`
	StopConvexhull *tl.Polygon  `json:"stop_convexhull"`
}

type RouteStopBufferParam

type RouteStopBufferParam struct {
	EntityID int
	Radius   *float64
	Limit    *int
}

type RouteStopParam

type RouteStopParam struct {
	RouteID int
	StopID  int
	Limit   *int
}

type Shape

type Shape struct {
	tl.Shape
}

type Stop

type Stop struct {
	FeedOnestopID   string
	FeedVersionSHA1 string
	OnestopID       *string
	SearchRank      *string
	tl.Stop
}

type StopFilter

type StopFilter struct {
	OnestopID       *string      `json:"onestop_id"`
	FeedVersionSha1 *string      `json:"feed_version_sha1"`
	FeedOnestopID   *string      `json:"feed_onestop_id"`
	StopID          *string      `json:"stop_id"`
	AgencyIds       []int        `json:"agency_ids"`
	Within          *tl.Polygon  `json:"within"`
	Near            *PointRadius `json:"near"`
	Search          *string      `json:"search"`
}

type StopParam

type StopParam struct {
	FeedVersionID int
	ParentStopID  int
	AgencyID      int
	Limit         *int
	Where         *StopFilter
}

type StopTime

type StopTime struct {
	tl.StopTime
}

type StopTimeFilter

type StopTimeFilter struct {
	ServiceDate *tl.ODate `json:"service_date"`
	StartTime   *int      `json:"start_time"`
	EndTime     *int      `json:"end_time"`
}

type StopTimeParam

type StopTimeParam struct {
	TripID int
	StopID int
	Limit  *int
	Where  *StopTimeFilter
}

type Trip

type Trip struct {
	tl.Trip
}

type TripFilter

type TripFilter struct {
	ServiceDate     *tl.ODate `json:"service_date"`
	TripID          *string   `json:"trip_id"`
	RouteID         *int      `json:"route_id"`
	FeedVersionSha1 *string   `json:"feed_version_sha1"`
	FeedOnestopID   *string   `json:"feed_onestop_id"`
}

type TripParam

type TripParam struct {
	FeedVersionID int
	RouteID       int
	Limit         *int
	Where         *TripFilter
}

type ValidationResult

type ValidationResult struct {
	Success              bool                         `json:"success"`
	FailureReason        string                       `json:"failure_reason"`
	Errors               []ValidationResultErrorGroup `json:"errors"`
	Warnings             []ValidationResultErrorGroup `json:"warnings"`
	Sha1                 string                       `json:"sha1"`
	EarliestCalendarDate tl.ODate                     `json:"earliest_calendar_date"`
	LatestCalendarDate   tl.ODate                     `json:"latest_calendar_date"`
	Files                []FeedVersionFileInfo        `json:"files"`
	ServiceLevels        []FeedVersionServiceLevel    `json:"service_levels"`
	Agencies             []Agency                     `json:"agencies"`
	Routes               []Route                      `json:"routes"`
	Stops                []Stop                       `json:"stops"`
	FeedInfos            []FeedInfo                   `json:"feed_infos"`
}

ValidationResult .

type ValidationResultError

type ValidationResultError struct {
	Filename  string `json:"filename"`
	ErrorType string `json:"error_type"`
	EntityID  string `json:"entity_id"`
	Field     string `json:"field"`
	Value     string `json:"value"`
	Message   string `json:"message"`
}

type ValidationResultErrorGroup

type ValidationResultErrorGroup struct {
	Filename  string                   `json:"filename"`
	ErrorType string                   `json:"error_type"`
	Count     int                      `json:"count"`
	Limit     int                      `json:"limit"`
	Errors    []*ValidationResultError `json:"errors"`
}

type ValueMap

type ValueMap map[string]interface{}

ValueMap is just a JSONB map[string]interface{}

func (*ValueMap) Scan

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

Scan load

func (ValueMap) Value

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

Value dump

Jump to

Keyboard shortcuts

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