Documentation ¶
Index ¶
- Constants
- type API
- func (a *API) Init(ctx context.Context) (*InitResponse, error)
- func (a *API) ListLines(ctx context.Context, modTypes []ModificationType, withSublines bool) (*LLResponse, error)
- func (a *API) ListStations(ctx context.Context, modTypes []ModificationType, coordType CoordinateType) (*LSResponse, error)
- type APIResponse
- type BaseRequest
- type CoordinateType
- type Coordniate
- type ErrorForbidden
- type ErrorGeneric
- type ErrorInternalServerError
- type ErrorNotFound
- type ErrorTooManyRequests
- type ErrorUnauthorized
- type Filter
- type GeofoxError
- type GeofoxReturnCode
- type InitRequest
- type InitResponse
- type LLRequest
- type LLResponse
- type LSRequest
- type LSResponse
- type Language
- type LineListEntry
- type ModificationType
- type Option
- type ServiceType
- type SimpleType
- type StationLight
- type StationListEntry
- type SublineListEntry
- type VehicleType
Constants ¶
View Source
const ( LangEnglish = "en" LangGerman = "de" )
View Source
const (
AuthTypeHmacSHA1 = "HmacSHA1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Username string Password string AuthType string BaseURL string // contains filtered or unexported fields }
func (*API) ListLines ¶
func (a *API) ListLines(ctx context.Context, modTypes []ModificationType, withSublines bool) (*LLResponse, error)
func (*API) ListStations ¶
func (a *API) ListStations(ctx context.Context, modTypes []ModificationType, coordType CoordinateType) (*LSResponse, error)
type BaseRequest ¶
type CoordinateType ¶
type CoordinateType string
const ( EPSG4326 CoordinateType = "EPSG_4326" EPSG31466 CoordinateType = "EPSG_31466" EPSG31467 CoordinateType = "EPSG_31467" EPSG31468 CoordinateType = "EPSG_31468" EPSG31469 CoordinateType = "EPSG_31469" )
type Coordniate ¶
type Coordniate struct { X float64 `json:"x"` Y float64 `json:"y"` Type CoordinateType `json:"type"` }
type ErrorForbidden ¶
type ErrorForbidden struct { StatusCode int ReturnCode GeofoxReturnCode }
func (*ErrorForbidden) Error ¶
func (e *ErrorForbidden) Error() string
type ErrorGeneric ¶
type ErrorGeneric struct { StatusCode int ReturnCode GeofoxReturnCode }
func (*ErrorGeneric) Error ¶
func (e *ErrorGeneric) Error() string
type ErrorInternalServerError ¶
type ErrorInternalServerError struct { StatusCode int ReturnCode GeofoxReturnCode }
func (*ErrorInternalServerError) Error ¶
func (e *ErrorInternalServerError) Error() string
type ErrorNotFound ¶
type ErrorNotFound struct { StatusCode int ReturnCode GeofoxReturnCode }
func (*ErrorNotFound) Error ¶
func (e *ErrorNotFound) Error() string
type ErrorTooManyRequests ¶
type ErrorTooManyRequests struct { StatusCode int ReturnCode GeofoxReturnCode }
func (*ErrorTooManyRequests) Error ¶
func (e *ErrorTooManyRequests) Error() string
type ErrorUnauthorized ¶
type ErrorUnauthorized struct {}
func (*ErrorUnauthorized) Error ¶
func (e *ErrorUnauthorized) Error() string
type GeofoxError ¶
type GeofoxError interface {
Error() string
}
type GeofoxReturnCode ¶
type GeofoxReturnCode string
const ( RCOK GeofoxReturnCode = "OK" RCCNTooMany GeofoxReturnCode = "ERROR_CN_TOO_MANY" RCCommError GeofoxReturnCode = "ERROR_COMM" RCRouteError GeofoxReturnCode = "ERROR_ROUTE" RCErrorText GeofoxReturnCode = "ERROR_TEXT" RCStartDestTooClose GeofoxReturnCode = "START_DEST_TOO_CLOSE" )
type InitRequest ¶
type InitRequest struct {
BaseRequest
}
type InitResponse ¶
type InitResponse struct { ReturnCode string `json:"returnCode"` BeginOfService string `json:"beginOfService"` EndOfService string `json:"endOfService"` ID string `json:"id"` DataID string `json:"dataId"` BuildDate string `json:"buildDate"` BuildTime string `json:"buildTime"` BuildText string `json:"buildText"` }
type LLRequest ¶
type LLRequest struct { BaseRequest WithSublines bool `json:"withSublines"` DataReleaseID string `json:"dataReleaseID"` ModificationTypes []ModificationType `json:"modificationTypes"` }
type LLResponse ¶
type LLResponse struct { ReturnCode GeofoxReturnCode `json:"returnCode"` ErrorText string `json:"errorText"` ErrorDevInfo string `json:"errorDevInfo"` DataReleaseID string `json:"dataReleaseID"` Lines []LineListEntry `json:"lines"` }
type LSRequest ¶
type LSRequest struct { BaseRequest DataReleaseID string `json:"dataReleaseID"` ModificationTypes []ModificationType `json:"modificationTypes"` CoordinateType CoordinateType `json:"coordinateType,omitempty"` FilterEquivalent bool `json:"filterEquivalent,omitempty"` }
type LSResponse ¶
type LSResponse struct { DataReleaseID string `json:"dataReleaseID,omitempty"` Stations []StationListEntry `json:"stations,omitempty"` }
type LineListEntry ¶
type LineListEntry struct { ID string `json:"id"` Name string `json:"name"` CarrierNameShort string `json:"carrierNameShort"` CarrierNameLong string `json:"carrierNameLong"` Sublines []SublineListEntry `json:"sublines"` Exists bool `json:"exists"` Type ServiceType `json:"type"` }
type ModificationType ¶
type ModificationType string
const ( ModTypeMain ModificationType = "MAIN" ModTypePosition ModificationType = "POSITION" ModTypeSequence ModificationType = "SEQUENCE" )
type ServiceType ¶
type ServiceType struct { SimpleType SimpleType `json:"simpleType"` ShortInfo string `json:"shortInfo"` LongInfo string `json:"longInfo"` Model string `json:"model"` }
type SimpleType ¶
type SimpleType string
const ( STBus SimpleType = "BUS" STTrain SimpleType = "TRAIN" STShip SimpleType = "SHIP" STFootpath SimpleType = "FOOTPATH" STBicycle SimpleType = "BICYCLE" STAirplane SimpleType = "AIRPLANE" STChange SimpleType = "CHANGE" STChangeSamePlatform SimpleType = "CHANGE_SAME_PLATFORM" )
type StationLight ¶
type StationListEntry ¶
type StationListEntry struct { ID string `json:"id"` Name string `json:"name"` City string `json:"city"` CombinedName string `json:"combinedName"` Shortcuts []string `json:"shortcuts"` Aliasses []string `json:"aliasses"` VehicleTypes []VehicleType `json:"vehicleTypes"` Coordniate Coordniate `json:"coordinate"` Exists bool `json:"exists"` }
type SublineListEntry ¶
type SublineListEntry struct { SublineNumber string `json:"sublineNumber"` VehicleType VehicleType `json:"vehicleType"` StationSequence []StationLight `json:"stationSequence"` }
type VehicleType ¶
type VehicleType string
const ( VTypeRegionalBus VehicleType = "REGIONALBUS" VTypeMetroBus VehicleType = "METROBUS" VTypeNachtBus VehicleType = "NACHTBUS" VTypeSchnellBus VehicleType = "SCHNELLBUS" VTypeXpressBus VehicleType = "XPRESSBUS" VTypeAST VehicleType = "AST" VTypeSchiff VehicleType = "SCHIFF" VTypeUBahn VehicleType = "U_BAHN" VTypeSBahn VehicleType = "S_BAHN" VTypeABahn VehicleType = "A_BAHN" VTypeRegionalbahn VehicleType = "R_BAHN" VTypeFernbahn VehicleType = "F_BAHN" VTypeEILBus VehicleType = "EILBUS" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.