ttss

package
v0.16.7 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bus  = "http://91.223.13.70"
	Tram = "http://185.70.182.51"
)

Variables

View Source
var (
	ErrStatusCode    = errors.New("got non 200 status code")
	ErrStopNotFound  = errors.New("stop not found")
	ErrRequestFailed = errors.New("request failed")
)

Functions

This section is empty.

Types

type Client added in v0.16.0

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

func NewClient added in v0.16.0

func NewClient(url string) *Client

func (Client) GetAllStops added in v0.16.0

func (c Client) GetAllStops() ([]Stop, error)

GetAllStops fetches Stops from given endpoint.

func (Client) GetDepartures added in v0.16.0

func (c Client) GetDepartures(id uint) ([]Departure, error)

GetDepartures from Endpoint for stop with given shortName.

type Departure added in v0.16.0

type Departure struct {
	PatternText  string
	Direction    string
	PlannedTime  string
	RelativeTime int32
	Predicted    bool
}

type Stop added in v0.16.0

type Stop struct {
	Name string
	Id   uint
}

Jump to

Keyboard shortcuts

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