cyprusbus

package
v0.0.0-...-17ae7c4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CityRoutesPage

type CityRoutesPage struct {
	Sid    string
	Name   string
	Routes []*RouteShort
}

type Client

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

func NewClient

func NewClient() *Client

func (*Client) AllStops

func (c *Client) AllStops() (*ExtAllStops, error)

func (*Client) CityRoutes

func (c *Client) CityRoutes(sid string) (*CityRoutesPage, error)

func (*Client) RouteInfo

func (c *Client) RouteInfo(routeID string) (*RouteFull, error)

type ExtAllStops

type ExtAllStops struct {
	ErrorCode    int           `json:"errorCode"`
	ErrorMessage string        `json:"errorMessage"`
	Data         []ExtStopInfo `json:"data"`
}

type ExtStopInfo

type ExtStopInfo struct {
	Order     int    `json:"order"`
	ID        int    `json:"id"`
	Title     string `json:"title"`
	Longitude string `json:"longitude"`
	Latitude  string `json:"latitude"`
}

type RouteFull

type RouteFull struct {
	ID   string
	Ways []Way
}

type RouteShort

type RouteShort struct {
	DetailsLink string
	ID          string
	Number      string
	Name        string
}

func ParseRouteShort

func ParseRouteShort(node *html.Node) (*RouteShort, error)

<td style="width:85%;"> <a href="https://www.cyprusbybus.com/RouteDetails.aspx?id=393"> <b><i>7A</i></b>, My Mall- Ipsonas Industrial Area - Leontiou EMEL Station - Old Market -TEPAK </a> </td>

type StopInfo

type StopInfo struct {
	ID        int
	Title     string
	Longitude float64
	Latitude  float64
}

func ParseStopInfo

func ParseStopInfo(ext ExtStopInfo) (StopInfo, error)

type StopRow

type StopRow struct {
	District    string
	DetailsLink string
	PathID      string
	StopID      int
	Name        string
}

func ParseStopRow

func ParseStopRow(node *html.Node) (*StopRow, error)

type Time

type Time struct {
	Hours   int
	Minutes int
}

func ParseTime

func ParseTime(text string) (Time, error)

type Timetable

type Timetable struct {
	Name     string
	Duration string
	Weekdays [7]Weekday
}

func ParseTimetable

func ParseTimetable(sel *goquery.Selection) (*Timetable, error)

type Way

type Way struct {
	SelectedTab string
	Stops       []StopRow
	Timetable   *Timetable
}

func ParseWay

func ParseWay(docOrig *goquery.Document) (*Way, error)

type Weekday

type Weekday struct {
	DepartureTimes []Time
}

Jump to

Keyboard shortcuts

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