sncf

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeTheoretical = "T"
	ModeRealTime    = "R"
)

Different mode returned by SNCF API for a station

View Source
const (
	StateTrainDelayed = "Retardé"
	StateTrainDeleted = "Supprimé"
)

Different state returned by SNCF API for one passage

Variables

View Source
var (
	// API is client for request to SNCF API
	API *api
)

Functions

func Init

func Init()

Init client for SNCF API

Types

type Passage

type Passage struct {
	XMLName xml.Name `xml:"train"`
	Date    struct {
		XMLName xml.Name `xml:"date"`
		Mode    string   `xml:"mode,attr"`
		String  string   `xml:",innerxml"`
	}
	TrainID    string `xml:"num"`
	Mission    string `xml:"miss"`
	TerminusID string `xml:"term"`
	State      string `xml:"etat"`
}

Passage represent response from SNCF API

func (Passage) GetTime

func (p Passage) GetTime() (time.Time, error)

GetTime parse time from SNCF API to time.Time

func (Passage) String

func (p Passage) String() string

Jump to

Keyboard shortcuts

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