utils

package
v0.0.0-...-9183e7c Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BoldFormat = color.New(color.FgWhite).Add(color.Bold).SprintFunc()

BoldFormat prints text in white/bold font

Functions

func Fetch

func Fetch(url string) *http.Response

Fetch is a http.Get helper

func FetchHTML

func FetchHTML(url string) *html.Node

FetchHTML returns a parsed HTML object

func FetchJSON

func FetchJSON(url string) string

FetchJSON returns a map of type

func GetTubeNames

func GetTubeNames() []string

GetTubeNames is a static list of available tube lines

func StopPointDeadline

func StopPointDeadline(ID string, line string, night bool) string

StopPointDeadline is HTML for first/last trains from station

func StopPointSearchURL

func StopPointSearchURL(query string) string

StopPointSearchURL search for station

func StopPointURL

func StopPointURL(ID string) string

StopPointURL data for station

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice checks if `x in arr`

func TubeStatus

func TubeStatus() string

TubeStatus returns all tube statuses

Types

type StopPointDataResp

type StopPointDataResp struct {
	Lines []struct {
		ID string
	}
}

StopPointDataResp gets the station ID

type StopPointSearchResp

type StopPointSearchResp struct {
	Total   int
	Matches []struct {
		IcsID string
		Name  string
		ID    string
	}
}

StopPointSearchResp contains stopPoint data

type Tube

type Tube struct {
	Name         string
	LineStatuses []struct {
		StatusSeverity            int
		StatusSeverityDescription string
		Reason                    string
	}
}

Tube contains ftl data

Jump to

Keyboard shortcuts

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