v1dot2

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package v1dot2 contains the type definitions for FerryAnnouncement v1.2.

All types have accessor methods to access fields which can be chained on nils. This makes it possible to easily drill down into deeply nested data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObjectType

func ObjectType() trv.ObjectType

Types

type FerryAnnouncement

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

func (*FerryAnnouncement) Acknowledged

func (x *FerryAnnouncement) Acknowledged() *time.Time

func (*FerryAnnouncement) CheckoutID

func (x *FerryAnnouncement) CheckoutID() *string

func (*FerryAnnouncement) Checkouts

func (x *FerryAnnouncement) Checkouts() *int64

func (*FerryAnnouncement) Deleted

func (x *FerryAnnouncement) Deleted() *bool

func (*FerryAnnouncement) DepartureTime

func (x *FerryAnnouncement) DepartureTime() *time.Time

SV: Avgångstid EN: Departure time

func (*FerryAnnouncement) DeviationID

func (x *FerryAnnouncement) DeviationID() *string

SV: Referens till Deviation.Id i objektet Situation EN: Reference to Deviation.Id in the Situation object

func (*FerryAnnouncement) FromHarbor

func (x *FerryAnnouncement) FromHarbor() *FromHarbor

SV: Avgår från EN: Departing from

func (*FerryAnnouncement) ID

func (x *FerryAnnouncement) ID() *int64

SV: Avgångens id EN: Departure id

func (*FerryAnnouncement) Info

func (x *FerryAnnouncement) Info() []string

SV: Information om avgången EN: Information about the departure

func (*FerryAnnouncement) ItemsAcknowledged

func (x *FerryAnnouncement) ItemsAcknowledged() *int64

func (*FerryAnnouncement) ItemsLeft

func (x *FerryAnnouncement) ItemsLeft() *int64

func (*FerryAnnouncement) LeasedUntil

func (x *FerryAnnouncement) LeasedUntil() *time.Time

func (*FerryAnnouncement) ModifiedTime

func (x *FerryAnnouncement) ModifiedTime() *time.Time

EN: Specifies when the object is stored. SV: Anger när objektet är sparat.

func (*FerryAnnouncement) Route

func (x *FerryAnnouncement) Route() *Route

SV: Information om rutten EN: Route information

func (*FerryAnnouncement) StatusCode

func (x *FerryAnnouncement) StatusCode() *uint8

func (*FerryAnnouncement) ToHarbor

func (x *FerryAnnouncement) ToHarbor() *ToHarbor

SV: Ankommer till EN: Arriving at

func (*FerryAnnouncement) UnmarshalXML

func (x *FerryAnnouncement) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type FromHarbor

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

func (*FromHarbor) ID

func (x *FromHarbor) ID() *int

SV: Avgår från (id) EN: Departing from (id)

func (*FromHarbor) Name

func (x *FromHarbor) Name() *string

SV: Avgår från (namn) EN: Departing from (name)

func (*FromHarbor) UnmarshalXML

func (x *FromHarbor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Response

type Response struct {
	XMLName xml.Name `xml:"RESPONSE"`
	Results []struct {
		Info struct {
			LastModified trv.LastModified `xml:"LASTMODIFIED"`
			LastChangeID string           `xml:"LASTCHANGEID"`
			EvalResult   []any            `xml:"EVALRESULT"`
			SSEURL       string           `xml:"SSEURL"`
		} `xml:"INFO"`
		Error *trv.APIError       `xml:"ERROR"`
		Data  []FerryAnnouncement `xml:"FerryAnnouncement"`
	} `xml:"RESULT"`
}

Response can be used to decode the response from the API.

For example:

package main

import (
	 "encoding/xml"
	 api "code.dny.dev/trafikinfo/trv/ferryannouncement/v1dot2"
)

func main() {
	var res api.Response
	err := xml.Unmarshal(data, &res)
}

func (Response) ErrorMsg

func (r Response) ErrorMsg() string

Errors returns a slice of trv.Error, if any error was included in the response.

func (Response) HasErrors

func (r Response) HasErrors() bool

HasErrors returns whether any of the results includes an error.

type Route

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

func (*Route) Description

func (x *Route) Description() *string

SV: Beskrivande text om rutten EN: Descriptive text about the route

func (*Route) ID

func (x *Route) ID() *int

SV: Ruttens id EN: Route id

func (*Route) Name

func (x *Route) Name() *string

SV: Ruttens namn EN: Route name

func (*Route) Shortname

func (x *Route) Shortname() *string

SV: Ruttens kortnamn EN: Short name of the route

func (*Route) Type

func (x *Route) Type() *Type

SV: Ledtyp EN: led type

func (*Route) UnmarshalXML

func (x *Route) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type ToHarbor

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

func (*ToHarbor) ID

func (x *ToHarbor) ID() *int

SV: Ankommer till (id) EN: Arriving at (id)

func (*ToHarbor) Name

func (x *ToHarbor) Name() *string

SV: Ankommer till (namn) EN: Arriving at (name)

func (*ToHarbor) UnmarshalXML

func (x *ToHarbor) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Type

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

func (*Type) ID

func (x *Type) ID() *int

SV: Id för ledtypen EN: id for led type

func (*Type) Name

func (x *Type) Name() *string

SV: Namn för ledtypen (ex. Vändande) EN: Name for the led type (ex. Flipping)

func (*Type) UnmarshalXML

func (x *Type) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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