parsers

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDasMessage

func ParseDasMessage(reader io.Reader) (arrival models.Arrival, err error)

ParseDasMessage parses a DAS XML message to an Arrival object

func ParseDvsMessage

func ParseDvsMessage(reader io.Reader) (departure models.Departure, err error)

ParseDvsMessage parses a DVS XML message to a Departure object

func ParseInfoPlusBoolean

func ParseInfoPlusBoolean(element *etree.Element) bool

ParseInfoPlusBoolean returns true when this is a InfoPlus boolean type which is true

func ParseInfoPlusDateTime

func ParseInfoPlusDateTime(element *etree.Element) time.Time

ParseInfoPlusDateTime translates an element with a date/time to a time.Time struct

func ParseInfoPlusDuration

func ParseInfoPlusDuration(element *etree.Element) int

ParseInfoPlusDuration translates an element with a duration (i.e., delays) to seconds

func ParseInfoPlusModifications

func ParseInfoPlusModifications(element *etree.Element) []models.Modification

ParseInfoPlusModifications parses a list of modifications

func ParseInfoPlusModificationsByElement

func ParseInfoPlusModificationsByElement(element *etree.Element, elementName string) []models.Modification

ParseInfoPlusModificationsByElement parses a list of modifications

func ParseInfoPlusPlatform

func ParseInfoPlusPlatform(elements []*etree.Element) string

ParseInfoPlusPlatform translates a platform element to a string

func ParseInfoPlusStation

func ParseInfoPlusStation(element *etree.Element) models.Station

ParseInfoPlusStation translates an XML InfoPlus station to a Station object

func ParseInfoPlusStations

func ParseInfoPlusStations(elements []*etree.Element) (stations []models.Station)

ParseInfoPlusStations process multiple station elements and returns them as a slice

func ParseIsoTime added in v1.1.2

func ParseIsoTime(timestamp string) time.Time

ParseIsoTime translates a string with a date/time to a time.Time struct

func ParseOptionalText

func ParseOptionalText(element *etree.Element) string

ParseOptionalText gets the text from an element, or returns an empty string when the element is nil.

func ParseRitMessage

func ParseRitMessage(reader io.Reader) (service models.Service, err error)

ParseRitMessage parses a RIT XML message to a Service object

func ParseWhenAttribute

func ParseWhenAttribute(element *etree.Element, tag, attribute, value string) *etree.Element

ParseWhenAttribute filters a list of elements on an attribute with a given value. Returns a single element, or nil.

func ParseWhenAttributeMulti

func ParseWhenAttributeMulti(element *etree.Element, tag, attribute, value string) []*etree.Element

ParseWhenAttributeMulti filters a list of elements on an attribute with a given value. Returns a slice with elements

Types

This section is empty.

Jump to

Keyboard shortcuts

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