darwin

package
v0.0.0-...-ad8fdfd Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRSSelector

func CRSSelector(crs string) string

func GetDeparturesAsJSON

func GetDeparturesAsJSON(crs string, r *http.Request) []byte

func GetDeparturesAsProto

func GetDeparturesAsProto(crs string, r *http.Request) []byte

func GetServiceDetailsAsJSON

func GetServiceDetailsAsJSON(id string, r *http.Request) []byte

func GetServiceDetailsAsProto

func GetServiceDetailsAsProto(id string, r *http.Request) []byte

func ServiceSelector

func ServiceSelector(service string) string

Types

type BoardService

type BoardService struct {
	ScheduledDeparture string    `xml:"std" json:"scheduledDeparture"`
	EstimatedDeparture string    `xml:"etd" json:"estimatedDeparture"`
	ScheduledArrival   string    `xml:"sta" json:"scheduledArrival"`
	EstimatedArrival   string    `xml:"eta" json:"estimatedArrival"`
	Platform           string    `xml:"platform" json:"platform"`
	Operator           string    `xml:"operator" json:"operator"`
	OperatorCode       string    `xml:"operatorCode" json:"operatorCode"`
	ServiceType        string    `xml:"serviceType" json:"serviceType"`
	ServiceID          ServiceID `xml:"serviceID" json:"serviceID"`
	Origin             Location  `xml:"origin>location" json:"origin"`
	Destination        Location  `xml:"destination>location" json:"destination"`
}

type CallingPoint

type CallingPoint struct {
	Location
	ScheduledTime string `xml:"st" json:"scheduledTime"`
	EstimatedTime string `xml:"et" json:"estimatedTime"`
	ActualTime    string `xml:"at" json:"actualTime"`
}

type DepartureBoard

type DepartureBoard struct {
	GeneratedAt       string         `xml:"generatedAt" json:"generatedAt"`
	Location          string         `xml:"locationName" json:"location"`
	CRS               string         `xml:"crs" json:"crs"`
	PlatformAvailable bool           `xml:"platformAvailable" json:"platformAvailable"`
	Services          []BoardService `xml:"trainServices>service" json:"services"`
}

type DepartureBoardResponse

type DepartureBoardResponse struct {
	Board DepartureBoard `xml:"Body>GetDepartureBoardResponse>GetStationBoardResult"`
}

func GetDepartures

func GetDepartures(crs string, r *http.Request) DepartureBoardResponse

type Location

type Location struct {
	CRS  string `xml:"crs" json:"crs"`
	Name string `xml:"locationName" json:"name"`
}

type ServiceDetail

type ServiceDetail struct {
	Location
	GeneratedAt             string         `xml:"generatedAt"`
	ServiceType             string         `xml:"serviceType"`
	Platform                int            `xml:"platform"`
	Operator                string         `xml:"operator"`
	OperatorCode            string         `xml:"operatorCode"`
	ScheduledDeparture      string         `xml:"std"`
	EstimatedDeparture      string         `xml:"etd"`
	SubsequentCallingPoints []CallingPoint `xml:"subsequentCallingPoints>callingPointList>callingPoint"`
}

type ServiceDetailResponse

type ServiceDetailResponse struct {
	Detail ServiceDetail `xml:"Body>GetServiceDetailsResponse>GetServiceDetailsResult"`
}

func GetServiceDetails

func GetServiceDetails(id string, r *http.Request) ServiceDetailResponse

type ServiceID

type ServiceID string

func (ServiceID) MarshalJSON

func (s ServiceID) MarshalJSON() ([]byte, error)

func (ServiceID) URLDecode

func (s ServiceID) URLDecode() string

func (ServiceID) URLEncode

func (s ServiceID) URLEncode() string

Jump to

Keyboard shortcuts

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