municommodels

package
v0.0.0-...-0da7da6 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CNRGetVehicles

type CNRGetVehicles struct {
	XMLName xml.Name `xml:"http://PublicService/ CNR_GetVehicles"`

	S  string `xml:"s"`
	R  string `xml:"r"`
	V  string `xml:"v"`
	D  string `xml:"d"`
	Nb string `xml:"nb"`
	Tp string `xml:"tp"`
}

CNRGetVehicles represents SOAP request body of an CNRGetVehicles endpoint.

type CNRGetVehiclesResponse

type CNRGetVehiclesResponse struct {
	XMLName xml.Name `xml:"http://PublicService/ CNR_GetVehiclesResponse"`

	CNRGetVehiclesResult struct {
		Unsanitized []string                        `xml:"p,omitempty"`
		Sanitized   []SanitizedCNRGetVehiclesResult `xml:"-"`
	} `xml:"CNR_GetVehiclesResult>VL,omitempty"`
}

func (*CNRGetVehiclesResponse) Sanitize

func (r *CNRGetVehiclesResponse) Sanitize() error

type Envelope

type Envelope struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`

	// Body represents SOAP response body
	Body struct {
		// InnerXML is actual response body to be unmarshaled
		InnerXML []byte `xml:",innerxml"`
	} `xml:"Body"`
}

Envelope represents SOAP response envelope

type GetRouteAndVariants

type GetRouteAndVariants struct {
	XMLName xml.Name `xml:"http://PublicService/ GetRouteAndVariants"`

	S        string `xml:"s"`
	Idwersja int    `xml:"id_wersja"`
	Q        string `xml:"q"`
}

GetRouteAndVariants represents SOAP request body of an GetRouteAndVariants endpoint.

type GetRouteAndVariantsResponse

type GetRouteAndVariantsResponse struct {
	XMLName xml.Name `xml:"http://PublicService/ GetRouteAndVariantsResponse"`

	GetRouteAndVariantsResult struct {
		L []struct {
			// Fields names are decoded from the JavaScript file from the site
			// where the data is from.
			Number       string `xml:"l,attr,omitempty"`
			Description  string `xml:"o,attr,omitempty"`
			Description2 string `xml:"o2,attr,omitempty"`
			Variant      int    `xml:"wt,attr,omitempty"`
			Transport    string `xml:"t,attr,omitempty"`
			Direction    string `xml:"d,attr,omitempty"`
		} `xml:"L,omitempty"`
	} `xml:"GetRouteAndVariantsResult>R,omitempty"`
}

type SanitizedCNRGetVehiclesResult

type SanitizedCNRGetVehiclesResult struct {
	// Fields names are decoded from the JavaScript file from the site where the
	// data is from.
	NrRadia          int
	Nb               int
	NumerLini        string
	WarTrasy         string
	Kierunek         string
	IdKursu          int
	LpPrzyst         int
	DrogaPlan        int
	DrogaWyko        int
	Dlugosc          float64
	Szerokosc        float64
	PrevDlugosc      float64
	PrevSzerokosc    float64
	Odchylenie       int
	OdchylenieStr    string
	Stan             int
	PlanGodzRozp     string
	NastIdKursu      int
	NastPlanGodzRozp string
	NastNumLini      string
	NastWarTrasy     string
	NastKierunek     string
	IleSekDoOdjazdu  int
	TypPojazdu       string
	Transport        string
	Cechy            string
	OpisTabl         string
	NastOpisTabl     string
	Wektor           float64
}

type WebServiceClient

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

WebServiceClient abstracts communication with PublicService.asmx @ PIS

func NewWebServiceClient

func NewWebServiceClient(logger logrus.FieldLogger, name, UA, URL string) *WebServiceClient

func (WebServiceClient) CallCNRGetVehicles

func (c WebServiceClient) CallCNRGetVehicles(ctx context.Context, cookies []http.Cookie,
	data CNRGetVehicles) (*CNRGetVehiclesResponse, error)

func (WebServiceClient) CallGetRouteAndVariants

func (c WebServiceClient) CallGetRouteAndVariants(ctx context.Context, cookies []http.Cookie,
	data GetRouteAndVariants) (*GetRouteAndVariantsResponse, error)

func (WebServiceClient) UnmarshalSOAP

func (WebServiceClient) UnmarshalSOAP(data []byte, v interface{}) error

Jump to

Keyboard shortcuts

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