rest

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: 26 Imported by: 0

Documentation

Index

Constants

View Source
const CIRCLESIZE = 10

CIRCLESIZE .

View Source
const CIRCLEWIDTH = 5

CIRCLEWIDTH .

View Source
const DEFAULTLIMIT = 20

DEFAULTLIMIT is the default API limit

View Source
const MAXLIMIT = 1000

MAXLIMIT is the API limit maximum

View Source
const MAXRADIUS = 100 * 1000.0

MAXRADIUS is the maximum point search radius

Variables

This section is empty.

Functions

func NewServer

func NewServer(cfg config.Config, srv http.Handler) (http.Handler, error)

NewServer .

Types

type AgencyRequest

type AgencyRequest struct {
	ID              int     `json:"id,string"`
	Limit           int     `json:"limit,string"`
	After           int     `json:"after,string"`
	AgencyID        string  `json:"agency_id"`
	AgencyName      string  `json:"agency_name"`
	OnestopID       string  `json:"onestop_id"`
	FeedVersionSHA1 string  `json:"feed_version_sha1"`
	FeedOnestopID   string  `json:"feed_onestop_id"`
	Search          string  `json:"search"`
	Lat             float64 `json:"lat,string"`
	Lon             float64 `json:"lon,string"`
	Radius          float64 `json:"radius,string"`
}

AgencyRequest holds options for a Route request

func (AgencyRequest) Query

func (r AgencyRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

func (AgencyRequest) ResponseKey

func (r AgencyRequest) ResponseKey() string

ResponseKey returns the GraphQL response entity key.

type FeedRequest

type FeedRequest struct {
	Key        string `json:"key"`
	ID         int    `json:"id,string"`
	Limit      int    `json:"limit,string"`
	After      int    `json:"after,string"`
	OnestopID  string `json:"onestop_id"`
	Spec       string `json:"spec"`
	Search     string `json:"search"`
	FetchError string `json:"fetch_error"`
}

FeedRequest holds options for a Route request

func (FeedRequest) Query

func (r FeedRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

type FeedVersionRequest

type FeedVersionRequest struct {
	Key           string `json:"key"`
	ID            int    `json:"id,string"`
	Limit         int    `json:"limit"`
	After         int    `json:"after"`
	FeedOnestopID string `json:"feed_onestop_id"`
	Sha1          string `json:"sha1"`
}

FeedVersionRequest holds options for a Route request

func (FeedVersionRequest) Query

func (r FeedVersionRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

type OperatorRequest

type OperatorRequest struct {
	ID              int    `json:"id,string"`
	Limit           int    `json:"limit,string"`
	After           int    `json:"after,string"`
	OnestopID       string `json:"onestop_id"`
	FeedVersionSHA1 string `json:"feed_version_sha1"`
	FeedOnestopID   string `json:"feed_onestop_id"`
	Search          string `json:"search"`
}

OperatorRequest holds options for a Route request

func (OperatorRequest) Query

func (r OperatorRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

func (OperatorRequest) ResponseKey

func (r OperatorRequest) ResponseKey() string

ResponseKey returns the GraphQL response entity key.

type RouteRequest

type RouteRequest struct {
	Key               string  `json:"key"`
	ID                int     `json:"id,string"`
	Limit             int     `json:"limit,string"`
	After             int     `json:"after,string"`
	RouteID           string  `json:"route_id"`
	RouteType         string  `json:"route_type"`
	OnestopID         string  `json:"onestop_id"`
	OperatorOnestopID string  `json:"operator_onestop_id"`
	IncludeGeometry   string  `json:"include_geometry"`
	Format            string  `json:"format"`
	Search            string  `json:"search"`
	AgencyID          int     `json:"agency_id,string"`
	FeedVersionSHA1   string  `json:"feed_version_sha1"`
	FeedOnestopID     string  `json:"feed_onestop_id"`
	Lat               float64 `json:"lat,string"`
	Lon               float64 `json:"lon,string"`
	Radius            float64 `json:"radius,string"`
}

RouteRequest holds options for a Route request

func (RouteRequest) Query

func (r RouteRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

func (RouteRequest) ResponseKey

func (r RouteRequest) ResponseKey() string

ResponseKey returns the GraphQL response entity key.

type StopRequest

type StopRequest struct {
	Key             string  `json:"key"`
	ID              int     `json:"id,string"`
	Limit           int     `json:"limit,string"`
	After           int     `json:"after,string"`
	StopID          string  `json:"stop_id"`
	OnestopID       string  `json:"onestop_id"`
	FeedVersionSHA1 string  `json:"feed_version_sha1"`
	FeedOnestopID   string  `json:"feed_onestop_id"`
	Search          string  `json:"search"`
	Lat             float64 `json:"lat,string"`
	Lon             float64 `json:"lon,string"`
	Radius          float64 `json:"radius,string"`
}

StopRequest holds options for a /stops request

func (StopRequest) Query

func (r StopRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

func (StopRequest) ResponseKey

func (r StopRequest) ResponseKey() string

ResponseKey returns the GraphQL response entity key.

type TripRequest

type TripRequest struct {
	ID              int    `json:"id,string"`
	Limit           int    `json:"limit,string"`
	After           int    `json:"after,string"`
	RouteID         int    `json:"route_id,string"`
	TripID          string `json:"trip_id,string"`
	FeedOnestopID   string `json:"feed_onestop_id,string"`
	FeedVersionSHA1 string `json:"feed_version_sha1"`
	IncludeGeometry string `json:"include_geometry"`
	ServiceDate     string `json:"service_date"`
	Format          string
}

TripRequest holds options for a /trips request

func (TripRequest) ProcessGeoJSON

func (r TripRequest) ProcessGeoJSON(response map[string]interface{}) error

ProcessGeoJSON .

func (TripRequest) Query

func (r TripRequest) Query() (string, map[string]interface{})

Query returns a GraphQL query string and variables.

func (TripRequest) ResponseKey

func (r TripRequest) ResponseKey() string

ResponseKey .

Jump to

Keyboard shortcuts

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