remote

package
v0.0.0-...-a6afe1d Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT requestType = iota
	SUBSCRIPTION
	NOTIFICATION
	CHECK_STATUS

	SUBSCRIPTION_TIMEOUT = 30 * time.Second
	CHECK_STATUS_TIMEOUT = 9 * time.Second
	DEFAULT_TIMEOUT      = 5 * time.Second
)
View Source
const (
	RAW_SIRI_ENVELOPE  = "raw"
	SOAP_SIRI_ENVELOPE = "soap"
)

Variables

This section is empty.

Functions

func NewGtfsError

func NewGtfsError(message string) error

func URI

func URI(baseurl string, path string, params url.Values) (*url.URL, error)

Types

type Buffer

type Buffer interface {
	io.Reader
	io.WriterTo
	WriteXML(string)
	String() string
	Length() int64
}

func NewSIRIBuffer

func NewSIRIBuffer(envelopeType string) Buffer

type GtfsError

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

To handle Partner Status after a Gtfs request

func (GtfsError) Error

func (e GtfsError) Error() string

type HTTPClient

type HTTPClient struct {
	HTTPClientUrls
	// contains filtered or unexported fields
}

func NewHTTPClient

func NewHTTPClient(opts HTTPClientOptions) *HTTPClient

func (*HTTPClient) GTFSRequest

func (c *HTTPClient) GTFSRequest() (*gtfs.FeedMessage, error)

func (*HTTPClient) HTTPClient

func (c *HTTPClient) HTTPClient() *http.Client

func (*HTTPClient) SIRIClient

func (c *HTTPClient) SIRIClient() *SIRIClient

func (*HTTPClient) SIRILiteClient

func (c *HTTPClient) SIRILiteClient() *SIRILiteClient

func (*HTTPClient) SetURLs

func (c *HTTPClient) SetURLs(urls HTTPClientUrls)

type HTTPClientOAuth

type HTTPClientOAuth struct {
	ClientID     string
	ClientSecret string
	TokenURL     string
	Scopes       []string
}

type HTTPClientOptions

type HTTPClientOptions struct {
	SiriEnvelopeType string
	OAuth            *HTTPClientOAuth
	Urls             HTTPClientUrls
	SiriCredential   SiriCredentialHeader
}

type HTTPClientUrls

type HTTPClientUrls struct {
	Url              string
	SubscriptionsUrl string
	NotificationsUrl string
}

type RawBuffer

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

func (*RawBuffer) Length

func (rb *RawBuffer) Length() int64

func (*RawBuffer) Read

func (rb *RawBuffer) Read(p []byte) (n int, err error)

func (*RawBuffer) String

func (rb *RawBuffer) String() string

func (*RawBuffer) WriteTo

func (rb *RawBuffer) WriteTo(w io.Writer) (n int64, err error)

func (*RawBuffer) WriteXML

func (rb *RawBuffer) WriteXML(xml string)

type Request

type Request interface {
	BuildXML(...string) (string, error)
}

type SIRIClient

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

func NewSIRIClient

func NewSIRIClient(c *HTTPClient, set string) *SIRIClient

func (*SIRIClient) CheckStatus

func (client *SIRIClient) CheckStatus(request *siri.SIRICheckStatusRequest) (*sxml.XMLCheckStatusResponse, error)

func (*SIRIClient) DeleteSubscription

func (client *SIRIClient) DeleteSubscription(request *siri.SIRIDeleteSubscriptionRequest) (*sxml.XMLDeleteSubscriptionResponse, error)

func (*SIRIClient) EstimatedTimetableSubscription

func (client *SIRIClient) EstimatedTimetableSubscription(request *siri.SIRIEstimatedTimetableSubscriptionRequest) (*sxml.XMLSubscriptionResponse, error)

func (*SIRIClient) GeneralMessageSubscription

func (client *SIRIClient) GeneralMessageSubscription(request *siri.SIRIGeneralMessageSubscriptionRequest) (*sxml.XMLSubscriptionResponse, error)

func (*SIRIClient) LineDiscovery

func (client *SIRIClient) LineDiscovery(request *siri.SIRILinesDiscoveryRequest) (*sxml.XMLLinesDiscoveryResponse, error)

func (*SIRIClient) NotifyEstimatedTimetable

func (client *SIRIClient) NotifyEstimatedTimetable(request *siri.SIRINotifyEstimatedTimetable) error

func (*SIRIClient) NotifyGeneralMessage

func (client *SIRIClient) NotifyGeneralMessage(request *siri.SIRINotifyGeneralMessage) error

func (*SIRIClient) NotifyProductionTimetable

func (client *SIRIClient) NotifyProductionTimetable(request *siri.SIRINotifyProductionTimetable) error

func (*SIRIClient) NotifySituationExchange

func (client *SIRIClient) NotifySituationExchange(request *siri.SIRINotifySituationExchange) error

func (*SIRIClient) NotifyStopMonitoring

func (client *SIRIClient) NotifyStopMonitoring(request *siri.SIRINotifyStopMonitoring) error

func (*SIRIClient) NotifyVehicleMonitoring

func (client *SIRIClient) NotifyVehicleMonitoring(request *siri.SIRINotifyVehicleMonitoring) error

func (*SIRIClient) SituationExchangeMonitoring

func (client *SIRIClient) SituationExchangeMonitoring(request *siri.SIRIGetSituationExchangeRequest) (*sxml.XMLSituationExchangeResponse, error)

func (*SIRIClient) SituationExchangeSubscription

func (client *SIRIClient) SituationExchangeSubscription(request *siri.SIRISituationExchangeSubscriptionRequest) (*sxml.XMLSubscriptionResponse, error)

func (*SIRIClient) SituationMonitoring

func (client *SIRIClient) SituationMonitoring(request *siri.SIRIGetGeneralMessageRequest) (*sxml.XMLGeneralMessageResponse, error)

func (*SIRIClient) StopDiscovery

func (*SIRIClient) StopMonitoring

func (client *SIRIClient) StopMonitoring(request *siri.SIRIGetStopMonitoringRequest) (*sxml.XMLStopMonitoringResponse, error)

func (*SIRIClient) StopMonitoringSubscription

func (client *SIRIClient) StopMonitoringSubscription(request *siri.SIRIStopMonitoringSubscriptionRequest) (*sxml.XMLSubscriptionResponse, error)

func (*SIRIClient) VehicleMonitoring

func (*SIRIClient) VehicleMonitoringSubscription

func (client *SIRIClient) VehicleMonitoringSubscription(request *siri.SIRIVehicleMonitoringSubscriptionRequest) (*sxml.XMLSubscriptionResponse, error)

type SIRIEnvelope

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

func NewAutodetectSIRIEnvelope

func NewAutodetectSIRIEnvelope(body io.Reader) (*SIRIEnvelope, error)

func NewSIRIEnvelope

func NewSIRIEnvelope(body io.Reader, envelopeType string) (*SIRIEnvelope, error)

func (*SIRIEnvelope) Body

func (envelope *SIRIEnvelope) Body() xml.Node

func (*SIRIEnvelope) BodyOrError

func (envelope *SIRIEnvelope) BodyOrError(expectedResponsess []string) (xml.Node, error)

func (*SIRIEnvelope) BodyType

func (envelope *SIRIEnvelope) BodyType() string

type SIRILiteClient

type SIRILiteClient struct {
	HTTPClientUrls
	// contains filtered or unexported fields
}

func NewSIRILiteClient

func NewSIRILiteClient(c *HTTPClient, credential SiriCredentialHeader) *SIRILiteClient

func (*SIRILiteClient) StopMonitoring

func (client *SIRILiteClient) StopMonitoring(stopArea string) (*slite.SIRILiteStopMonitoring, error)

type SOAPBuffer

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

func (*SOAPBuffer) Length

func (sb *SOAPBuffer) Length() int64

func (*SOAPBuffer) Read

func (sb *SOAPBuffer) Read(p []byte) (n int, err error)

func (*SOAPBuffer) String

func (sb *SOAPBuffer) String() string

func (*SOAPBuffer) WriteTo

func (sb *SOAPBuffer) WriteTo(w io.Writer) (n int64, err error)

func (*SOAPBuffer) WriteXML

func (sb *SOAPBuffer) WriteXML(xml string)

type SiriCredentialHeader

type SiriCredentialHeader struct {
	CredentialHeader string
	Value            string
}

Jump to

Keyboard shortcuts

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