v1dot2

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Overview

Package v1dot2 contains the type definitions for FerryRoute 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 Deviation

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

func (*Deviation) Description

func (x *Deviation) Description() *string

SV: Beskrivning av avvikelsen EN: Description of the deviation

func (*Deviation) FromDate

func (x *Deviation) FromDate() *string

SV: Om avvikelsen gäller under en period så finns den en sträng fråndatum med formatet "mmdd" EN: If the deviation applies for a period, there is a string from date with the format "mmdd"

func (*Deviation) ID

func (x *Deviation) ID() *string

SV: Avvikelsens id EN: The id of the deviation

func (*Deviation) SpecDate

func (x *Deviation) SpecDate() *string

SV: Om avvikelsen gäller specifika datum läggs de till en sträng med formatet "mmdd, mmdd" EN: If the discrepancy applies to specific dates, they are added to a string with the format "mmdd, mmdd

func (*Deviation) ToDate

func (x *Deviation) ToDate() *string

SV: Om avvikelsen gäller under en period så finns den en sträng slutdatum med formatet "mmdd" EN: If the deviation applies for a period, there is a string end date with the format "mmdd"

func (*Deviation) Type

func (x *Deviation) Type() *DeviationType

func (*Deviation) UnmarshalXML

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

type DeviationType

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

func (*DeviationType) ID

func (x *DeviationType) ID() *string

SV: Avvikelsetypens id EN: Anomaly type ID

func (*DeviationType) Name

func (x *DeviationType) Name() *string

SV: Avvikelsetypens namn, det finns fyra: "Meddelande", "Kallelse", "Går" & "Går ej" EN: The name of the deviation type, there are four: "Meddelande", "Kallelse", "Går" & "Går ej"

func (*DeviationType) UnmarshalXML

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

type FerryRoute

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

func (*FerryRoute) Acknowledged

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

func (*FerryRoute) CheckoutID

func (x *FerryRoute) CheckoutID() *string

func (*FerryRoute) Checkouts

func (x *FerryRoute) Checkouts() *int64

func (*FerryRoute) Deleted

func (x *FerryRoute) Deleted() *bool

func (*FerryRoute) DeviationID

func (x *FerryRoute) DeviationID() *string

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

func (*FerryRoute) Geometry

func (x *FerryRoute) Geometry() *Geometry

func (*FerryRoute) Harbors

func (x *FerryRoute) Harbors() []Harbor

func (*FerryRoute) ID

func (x *FerryRoute) ID() *int

SV: Ledens id EN: Trail ID

func (*FerryRoute) ItemsAcknowledged

func (x *FerryRoute) ItemsAcknowledged() *int64

func (*FerryRoute) ItemsLeft

func (x *FerryRoute) ItemsLeft() *int64

func (*FerryRoute) LeasedUntil

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

func (*FerryRoute) ModifiedTime

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

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

func (*FerryRoute) Name

func (x *FerryRoute) Name() *string

SV: Ledens namn EN: Name of the trail

func (*FerryRoute) Shortname

func (x *FerryRoute) Shortname() *string

SV: Förkortning av ledens namn EN: Abbreviation of the name of the trail

func (*FerryRoute) StatusCode

func (x *FerryRoute) StatusCode() *uint8

func (*FerryRoute) Timetables

func (x *FerryRoute) Timetables() []Timetable

func (*FerryRoute) Type

func (x *FerryRoute) Type() *Type

func (*FerryRoute) UnmarshalXML

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

type Geometry

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

func (*Geometry) SWEREF99TM

func (x *Geometry) SWEREF99TM() *string

SV: Geometrisk punkt i koordinatsystem SWEREF99TM EN: Geometric point in coordinate system SWEREF99TM

func (*Geometry) UnmarshalXML

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

func (*Geometry) WGS84

func (x *Geometry) WGS84() *string

SV: Geometrisk punkt i koordinatsystem WGS84 EN: Geometric point in coordinate system WGS84

type Harbor

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

func (*Harbor) ID

func (x *Harbor) ID() *int

SV: Hamnens id EN: Port ID

func (*Harbor) Name

func (x *Harbor) Name() *string

SV: Hamnens namn EN: Name of the port

func (*Harbor) SortOrder

func (x *Harbor) SortOrder() *int

SV: Sorteringsordning EN: Sort order

func (*Harbor) StopType

func (x *Harbor) StopType() *StopType

func (*Harbor) UnmarshalXML

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

type Period

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

func (*Period) Name

func (x *Period) Name() *string

SV: Periodens namn EN: Name of the period

func (*Period) Schedules

func (x *Period) Schedules() []Schedule

func (*Period) SortOrder

func (x *Period) SortOrder() *int

SV: Periodens sorteringsordning EN: Sort order of the period

func (*Period) UnmarshalXML

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

func (*Period) Weekdays

func (x *Period) Weekdays() []Weekday

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  []FerryRoute  `xml:"FerryRoute"`
	} `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/ferryroute/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 Schedule

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

func (*Schedule) Deviations

func (x *Schedule) Deviations() []Deviation

func (*Schedule) Harbor

func (x *Schedule) Harbor() *Harbor

func (*Schedule) SortOrder

func (x *Schedule) SortOrder() *int

SV: Sorteringsordning EN: Sort order

func (*Schedule) StopType

func (x *Schedule) StopType() *StopType

func (*Schedule) Time

func (x *Schedule) Time() *string

SV: Tidpunkt för händelse EN: Time of event

func (*Schedule) UnmarshalXML

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

type StopType

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

func (*StopType) ID

func (x *StopType) ID() *int

SV: Stopptypens id EN: Stop type ID

func (*StopType) Name

func (x *StopType) Name() *string

SV: Namn på stopptypen. Det finns tre olika "Avg", "Ank/Avg" & "Ank" EN: Name of the stop type. There are three different "Avg", "Ank/Avg" & "Ank"

func (*StopType) UnmarshalXML

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

func (*StopType) Visible

func (x *StopType) Visible() *bool

SV: De med värdet true är synliga i tidtabellen EN: Those with a value of true are visible in the timetable

type Timetable

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

func (*Timetable) Description

func (x *Timetable) Description() *string

SV: Tidtabellens beskrivning EN: Description of the timetable

func (*Timetable) Periods

func (x *Timetable) Periods() []Period

func (*Timetable) Priority

func (x *Timetable) Priority() *int

SV: Tidtabellens prioritet, det kan finnas flera tidtabeller som är giltiga samma datum, den med högst prioritet gäller. EN: The priority of the timetable, there may be several timetables valid on the same date, the one with the highest priority applies.

func (*Timetable) UnmarshalXML

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

func (*Timetable) Valid

func (x *Timetable) Valid() []Valid

type Type

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

func (*Type) ID

func (x *Type) ID() *int

SV: Ledtypens id EN: Led type ID

func (*Type) Name

func (x *Type) Name() *string

SV: Ledtypens namn EN: Name of the joint type

func (*Type) UnmarshalXML

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

type Valid

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

func (*Valid) From

func (x *Valid) From() *time.Time

SV: Datumet då tidtabellen börjar gälla EN: The date on which the timetable takes effect

func (*Valid) To

func (x *Valid) To() *time.Time

SV: Datumet då tidtabellen slutar gälla EN: The date the timetable expires

func (*Valid) UnmarshalXML

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

type Weekday

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

func (*Weekday) Day

func (x *Weekday) Day() *string

SV: Veckodagar som ingår i perioden (dagens namn) EN: Days of the week included in the period (day name)

func (*Weekday) ID

func (x *Weekday) ID() *int

SV: Veckodagar som ingår i perioden (dagens id) EN: Days of the week included in the period (day id)

func (*Weekday) UnmarshalXML

func (x *Weekday) 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