Documentation
¶
Index ¶
Constants ¶
View Source
const ESTACION_SELECTOR = ".estadoEstaciones > li"
View Source
const HolidayURL = "https://apis.digital.gob.cl/fl/feriados/%d/%d/%d"
View Source
const KeyValURL = "https://www.metro.cl/api/estadoRedDetalle.php"
View Source
const STATUS_SELECTOR = "#estadoRed .row.pTop30 > .col-md-12 > .row"
View Source
const TimeURL = "https://www.metro.cl/api/horariosEstacion.php?cod=%s"
View Source
const URL = "https://metro.cl/tu-viaje/estado-red"
Variables ¶
View Source
var ToStatusCode = map[string]StatusCode{
"estado1": 0,
"estado2": 1,
"estado3": 2,
"estado4": 3,
}
Functions ¶
This section is empty.
Types ¶
type CompositeTime ¶
type DayResponse ¶
type KeyValResponse ¶
type LineResponse ¶
type LineResponse struct {
Name string `json:"name"`
ID string `json:"id"`
Issues bool `json:"issues"`
StationsClosedBySchedule int `json:"stations_closed_by_schedule"`
Stations []*StationResponse `json:"stations"`
}
type OpenCloseResponse ¶
type OpenCloseResponse struct {
Abrir DayResponse `json:"abrir"`
Cerrar DayResponse `json:"cerrar"`
}
type Parser ¶
type Parser struct {
HTTPRequest http.Request
StationTimes map[string]*CompositeTime
IsHoliday bool
}
func (*Parser) GetCronTasks ¶
func (*Parser) StartParser ¶
func (bp *Parser) StartParser()
func (*Parser) StopParser ¶
func (bp *Parser) StopParser()
type Response ¶
type Response struct {
APIStatus string `json:"api_status"`
Time string `json:"time"`
Issues bool `json:"issues"`
Lines []*LineResponse `json:"lines"`
}
type ScheduleResponse ¶
type ScheduleResponse struct {
Estacion OpenCloseResponse `json:"estacion"`
}
type StationResponse ¶
type StationResponse struct {
Name string `json:"name"`
ID string `json:"id"`
Status StatusCode `json:"status"`
Lines []string `json:"lines,omitempty"`
Description string `json:"description,omitempty"`
Reason string `json:"reason,omitempty"`
IsClosedBySchedule bool `json:"is_closed_by_schedule"`
Schedule *CompositeTime `json:"schedule"`
}
type StatusCode ¶
type StatusCode int
Click to show internal directories.
Click to hide internal directories.