navitia_api_client

package
v0.0.0-...-71330bb Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

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

navitia api query error

func (ApiError) Error

func (e ApiError) Error() string

type Client

type Client interface {
	GetDepartures(stop string) (departures []model.Departure, err error)
	GetStops() (stops []model.Stop, err error)
}

func NewClient

func NewClient(token string) Client

type DateParsingError

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

date parsing error

func (DateParsingError) Error

func (e DateParsingError) Error() string

func (DateParsingError) Unwrap

func (e DateParsingError) Unwrap() error

type DeparturesResponse

type DeparturesResponse struct {
	Disruptions []interface{} `json:"disruptions"`
	Notes       []interface{} `json:"notes"`
	Departures  []struct {
		DisplayInformations struct {
			Direction      string        `json:"direction"`
			Code           string        `json:"code"`
			Network        string        `json:"network"`
			Links          []interface{} `json:"links"`
			Color          string        `json:"color"`
			Name           string        `json:"name"`
			PhysicalMode   string        `json:"physical_mode"`
			Headsign       string        `json:"headsign"`
			Label          string        `json:"label"`
			Equipments     []interface{} `json:"equipments"`
			TextColor      string        `json:"text_color"`
			TripShortName  string        `json:"trip_short_name"`
			CommercialMode string        `json:"commercial_mode"`
			Description    string        `json:"description"`
		} `json:"display_informations"`
		StopDateTime struct {
			Links                  []interface{} `json:"links"`
			ArrivalDateTime        string        `json:"arrival_date_time"`
			AdditionalInformations []interface{} `json:"additional_informations"`
			DepartureDateTime      string        `json:"departure_date_time"`
			BaseArrivalDateTime    string        `json:"base_arrival_date_time"`
			BaseDepartureDateTime  string        `json:"base_departure_date_time"`
			DataFreshness          string        `json:"data_freshness"`
		} `json:"stop_date_time"`
	} `json:"departures"`
	Context struct {
		Timezone        string `json:"timezone"`
		CurrentDatetime string `json:"current_datetime"`
	} `json:"context"`
}

type HttpClientError

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

http client error

func (HttpClientError) Error

func (e HttpClientError) Error() string

func (HttpClientError) Unwrap

func (e HttpClientError) Unwrap() error

type JsonDecodeError

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

json decoding error

func (JsonDecodeError) Error

func (e JsonDecodeError) Error() string

func (JsonDecodeError) Unwrap

func (e JsonDecodeError) Unwrap() error
type NavitiaClient struct {
	// contains filtered or unexported fields
}
func (c *NavitiaClient) GetDepartures(stop string) (departures []model.Departure, err error)
func (c *NavitiaClient) GetStops() (stops []model.Stop, err error)

type StopsResponse

type StopsResponse struct {
	Pagination struct {
		StartPage    int `json:"start_page"`
		ItemsOnPage  int `json:"items_on_page"`
		ItemsPerPage int `json:"items_per_page"`
		TotalResult  int `json:"total_result"`
	} `json:"pagination"`
	StopAreas []struct {
		Name                 string        `json:"name"`
		ID                   string        `json:"id"`
		Codes                []interface{} `json:"codes"`
		Links                []interface{} `json:"links"`
		Coord                interface{}   `json:"coord"`
		Label                string        `json:"label"`
		Timezone             interface{}   `json:"timezone"`
		AdministrativeRegion interface{}   `json:"administrative_regions"`
	} `json:"stop_areas"`
	Links          []interface{} `json:"links"`
	Disruptions    []interface{} `json:"disruptions"`
	FeedPublishers []interface{} `json:"feed_publishers"`
	Context        interface{}   `json:"context"`
}

Jump to

Keyboard shortcuts

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